Skip to content

Commit 0b7181d

Browse files
authored
Deprecate instrumentation scope processor (#1960)
1 parent 33abff7 commit 0b7181d

506 files changed

Lines changed: 6541 additions & 3842 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/active_directory_ds.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ func (r MetricsReceiverActiveDirectoryDS) Pipelines(_ context.Context) ([]otel.R
4545
otel.MetricsTransform(
4646
otel.AddPrefix("workload.googleapis.com"),
4747
),
48-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
48+
otel.TransformationMetrics(
49+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
50+
otel.SetScopeVersion("1.0"),
51+
),
4952
}},
5053
}}, nil
5154
}

apps/activemq.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ func (r MetricsReceiverActivemq) Pipelines(_ context.Context) ([]otel.ReceiverPi
4747
otel.MetricsTransform(
4848
otel.AddPrefix("workload.googleapis.com"),
4949
),
50-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
50+
otel.TransformationMetrics(
51+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
52+
otel.SetScopeVersion("1.0"),
53+
),
5154
},
5255
)
5356
}

apps/aerospike.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ func (r MetricsReceiverAerospike) Pipelines(_ context.Context) ([]otel.ReceiverP
9696
otel.TransformationMetrics(
9797
otel.FlattenResourceAttribute("aerospike.node.name", "node_name"),
9898
otel.FlattenResourceAttribute("aerospike.namespace", "namespace_name"),
99+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
100+
otel.SetScopeVersion("1.0"),
99101
),
100-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
101102
}},
102103
}}, nil
103104
}

apps/apache.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func (r MetricsReceiverApache) Pipelines(_ context.Context) ([]otel.ReceiverPipe
6060
),
6161
otel.TransformationMetrics(
6262
otel.FlattenResourceAttribute("apache.server.name", "server_name"),
63+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
64+
otel.SetScopeVersion("1.0"),
6365
),
64-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
6566
}},
6667
}}, nil
6768
}

apps/cassandra.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ func (r MetricsReceiverCassandra) Pipelines(_ context.Context) ([]otel.ReceiverP
4848
otel.MetricsTransform(
4949
otel.AddPrefix("workload.googleapis.com"),
5050
),
51-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
51+
otel.TransformationMetrics(
52+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
53+
otel.SetScopeVersion("1.0"),
54+
),
5255
},
5356
)
5457
}

apps/couchbase.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,13 @@ func (r MetricsReceiverCouchbase) Pipelines(_ context.Context) ([]otel.ReceiverP
160160
otel.AddPrefix("workload.googleapis.com"),
161161
),
162162
// Using the transform processor for metrics
163-
otel.TransformationMetrics(r.transformMetrics()...),
164-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
163+
otel.TransformationMetrics(
164+
append(
165+
r.transformMetrics(),
166+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
167+
otel.SetScopeVersion("1.0"),
168+
)...,
169+
),
165170
}},
166171
}}, nil
167172
}

apps/couchdb.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ func (r MetricsReceiverCouchdb) Pipelines(_ context.Context) ([]otel.ReceiverPip
5959
otel.MetricsTransform(
6060
otel.AddPrefix("workload.googleapis.com"),
6161
),
62-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
62+
otel.TransformationMetrics(
63+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
64+
otel.SetScopeVersion("1.0"),
65+
),
6366
}},
6467
}}, nil
6568
}

apps/dcgm.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ func (r MetricsReceiverDcgm) Pipelines(_ context.Context) ([]otel.ReceiverPipeli
8888
otel.FlattenResourceAttribute("gpu.model", "model"),
8989
otel.FlattenResourceAttribute("gpu.number", "gpu_number"),
9090
otel.FlattenResourceAttribute("gpu.uuid", "uuid"),
91+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
92+
otel.SetScopeVersion("2.0"),
9193
),
92-
otel.ModifyInstrumentationScope(r.Type(), "2.0"),
9394
}},
9495
}}, nil
9596
}
@@ -199,8 +200,9 @@ func (r MetricsReceiverDcgm) Pipelines(_ context.Context) ([]otel.ReceiverPipeli
199200
otel.FlattenResourceAttribute("gpu.model", "model"),
200201
otel.FlattenResourceAttribute("gpu.number", "gpu_number"),
201202
otel.FlattenResourceAttribute("gpu.uuid", "uuid"),
203+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
204+
otel.SetScopeVersion("1.0"),
202205
),
203-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
204206
}},
205207
}}, nil
206208
}

apps/elasticsearch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ func (r MetricsReceiverElasticsearch) Pipelines(_ context.Context) ([]otel.Recei
8989
otel.MetricsTransform(
9090
otel.AddPrefix("workload.googleapis.com"),
9191
),
92-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
92+
otel.TransformationMetrics(
93+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
94+
otel.SetScopeVersion("1.0"),
95+
),
9396
}},
9497
}}, nil
9598
}

apps/flink.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ func (r MetricsReceiverFlink) Pipelines(_ context.Context) ([]otel.ReceiverPipel
6161
otel.FlattenResourceAttribute("flink.task.name", "task_name"),
6262
otel.FlattenResourceAttribute("flink.subtask.index", "subtask_index"),
6363
otel.FlattenResourceAttribute("flink.resource.type", "resource_type"),
64+
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
65+
otel.SetScopeVersion("1.0"),
6466
),
65-
otel.ModifyInstrumentationScope(r.Type(), "1.0"),
6667
}},
6768
}}, nil
6869
}

0 commit comments

Comments
 (0)