forked from open-telemetry/opentelemetry-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple entity refs in the Resource
- Loading branch information
1 parent
781faa5
commit b4611c8
Showing
9 changed files
with
404 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package resource | ||
|
||
import "go.opentelemetry.io/otel/attribute" | ||
|
||
type Entity struct { | ||
Type string | ||
Id attribute.Set | ||
Attrs attribute.Set | ||
SchemaURL string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package resource | ||
|
||
import "go.opentelemetry.io/otel/attribute" | ||
|
||
type resourceEntityRef struct { | ||
SchemaUrl string | ||
|
||
// Defines the entity type, e.g "service", "k8s.pod", etc. | ||
Type string | ||
|
||
// Set of Resource attribute keys that identify the entity. | ||
Id map[attribute.Key]bool | ||
|
||
// Set of Resource attribute keys that describe the entity. | ||
Attrs map[attribute.Key]bool | ||
|
||
// Id and Attrs materialized as slices for faster exporting. | ||
IdKeys []string | ||
AttrsKeys []string | ||
} | ||
|
||
func (r *resourceEntityRef) materialize() { | ||
for k := range r.Id { | ||
r.IdKeys = append(r.IdKeys, string(k)) | ||
} | ||
for k := range r.Attrs { | ||
r.AttrsKeys = append(r.AttrsKeys, string(k)) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.