Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otlpmetric: Add instrumentation scope attributes #5935

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
otlpmetric: Add instrumentation scope attributes
pellared committed Oct 30, 2024
commit 469474b4d211d2439a106c3c122be4a3e53140cb
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -19,6 +19,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
The package contains semantic conventions from the `v1.27.0` version of the OpenTelemetry Semantic Conventions. (#5894)
- Add `Attributes attribute.Set` field to `Scope` in `go.opentelemetry.io/otel/sdk/instrumentation`. (#5903)
- Add `Attributes attribute.Set` field to `ScopeRecords` in `go.opentelemetry.io/otel/log/logtest`. (#5927)
- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` adds instrumentation scope attributes. (#5935)
- `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` adds instrumentation scope attributes. (#5935)

### Fixed

Original file line number Diff line number Diff line change
@@ -46,8 +46,9 @@ func ScopeMetrics(sms []metricdata.ScopeMetrics) ([]*mpb.ScopeMetrics, error) {

out = append(out, &mpb.ScopeMetrics{
Scope: &cpb.InstrumentationScope{
Name: sm.Scope.Name,
Version: sm.Scope.Version,
Name: sm.Scope.Name,
Version: sm.Scope.Version,
Attributes: AttrIter(sm.Scope.Attributes.Iter()),
},
Metrics: ms,
SchemaUrl: sm.Scope.SchemaURL,
Original file line number Diff line number Diff line change
@@ -805,9 +805,10 @@ var (
otelScopeMetrics = []metricdata.ScopeMetrics{
{
Scope: instrumentation.Scope{
Name: "test/code/path",
Version: "v0.1.0",
SchemaURL: semconv.SchemaURL,
Name: "test/code/path",
Version: "v0.1.0",
SchemaURL: semconv.SchemaURL,
Attributes: attribute.NewSet(attribute.String("foo", "bar")),
},
Metrics: otelMetrics,
},
@@ -818,6 +819,14 @@ var (
Scope: &cpb.InstrumentationScope{
Name: "test/code/path",
Version: "v0.1.0",
Attributes: []*cpb.KeyValue{
{
Key: "foo",
Value: &cpb.AnyValue{
Value: &cpb.AnyValue_StringValue{StringValue: "bar"},
},
},
},
},
Metrics: pbMetrics,
SchemaUrl: semconv.SchemaURL,
Original file line number Diff line number Diff line change
@@ -46,8 +46,9 @@ func ScopeMetrics(sms []metricdata.ScopeMetrics) ([]*mpb.ScopeMetrics, error) {

out = append(out, &mpb.ScopeMetrics{
Scope: &cpb.InstrumentationScope{
Name: sm.Scope.Name,
Version: sm.Scope.Version,
Name: sm.Scope.Name,
Version: sm.Scope.Version,
Attributes: AttrIter(sm.Scope.Attributes.Iter()),
},
Metrics: ms,
SchemaUrl: sm.Scope.SchemaURL,
Original file line number Diff line number Diff line change
@@ -805,9 +805,10 @@ var (
otelScopeMetrics = []metricdata.ScopeMetrics{
{
Scope: instrumentation.Scope{
Name: "test/code/path",
Version: "v0.1.0",
SchemaURL: semconv.SchemaURL,
Name: "test/code/path",
Version: "v0.1.0",
SchemaURL: semconv.SchemaURL,
Attributes: attribute.NewSet(attribute.String("foo", "bar")),
},
Metrics: otelMetrics,
},
@@ -818,6 +819,14 @@ var (
Scope: &cpb.InstrumentationScope{
Name: "test/code/path",
Version: "v0.1.0",
Attributes: []*cpb.KeyValue{
{
Key: "foo",
Value: &cpb.AnyValue{
Value: &cpb.AnyValue_StringValue{StringValue: "bar"},
},
},
},
},
Metrics: pbMetrics,
SchemaUrl: semconv.SchemaURL,
Original file line number Diff line number Diff line change
@@ -46,8 +46,9 @@ func ScopeMetrics(sms []metricdata.ScopeMetrics) ([]*mpb.ScopeMetrics, error) {

out = append(out, &mpb.ScopeMetrics{
Scope: &cpb.InstrumentationScope{
Name: sm.Scope.Name,
Version: sm.Scope.Version,
Name: sm.Scope.Name,
Version: sm.Scope.Version,
Attributes: AttrIter(sm.Scope.Attributes.Iter()),
},
Metrics: ms,
SchemaUrl: sm.Scope.SchemaURL,
Original file line number Diff line number Diff line change
@@ -805,9 +805,10 @@ var (
otelScopeMetrics = []metricdata.ScopeMetrics{
{
Scope: instrumentation.Scope{
Name: "test/code/path",
Version: "v0.1.0",
SchemaURL: semconv.SchemaURL,
Name: "test/code/path",
Version: "v0.1.0",
SchemaURL: semconv.SchemaURL,
Attributes: attribute.NewSet(attribute.String("foo", "bar")),
},
Metrics: otelMetrics,
},
@@ -818,6 +819,14 @@ var (
Scope: &cpb.InstrumentationScope{
Name: "test/code/path",
Version: "v0.1.0",
Attributes: []*cpb.KeyValue{
{
Key: "foo",
Value: &cpb.AnyValue{
Value: &cpb.AnyValue_StringValue{StringValue: "bar"},
},
},
},
},
Metrics: pbMetrics,
SchemaUrl: semconv.SchemaURL,