-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[exporter/datadog]: update resource naming and span naming #1861
[exporter/datadog]: update resource naming and span naming #1861
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1861 +/- ##
=======================================
Coverage 90.19% 90.19%
=======================================
Files 385 385
Lines 19063 19074 +11
=======================================
+ Hits 17193 17204 +11
- Misses 1398 1399 +1
+ Partials 472 471 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
cc @mx-psi and @KSerrania here for review from datadog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, we should fix the two lines where codecov complains.
@@ -380,33 +382,47 @@ func getDatadogSpanName(s pdata.Span, datadogTags map[string]string) string { | |||
// The spec has changed over time and, depending on the original exporter, IL Name could represented a few different ways | |||
// so we try to account for all permutations | |||
if ilnOtlp, okOtlp := datadogTags[tracetranslator.TagInstrumentationName]; okOtlp { | |||
return utils.NormalizeSpanName(fmt.Sprintf("%s.%s", ilnOtlp, s.Kind())) | |||
return utils.NormalizeSpanName(fmt.Sprintf("%s.%s", ilnOtlp, strings.TrimPrefix(s.Kind().String(), "SPAN_KIND_"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: strings.TrimPrefix(<a string>, "SPAN_KIND_")
is being used in a lot of places, maybe it would make sense to move this to a utility function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense will do
return fmt.Sprintf("%s %s", msgOperation, destination) | ||
} | ||
|
||
return msgOperation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a test case where messaging.operation
is set but not messaging.destination
to test this code path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 yup will add test
@@ -80,7 +80,8 @@ func NormalizeSpanName(tag string) string { | |||
case buf.Len() == 0: | |||
continue | |||
// handle valid characters that can't start the string. | |||
case unicode.IsDigit(c) || c == '.' || c == '-': | |||
// '-' creates issues in the UI so we skip it | |||
case unicode.IsDigit(c) || c == '.': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably add a tag with a digit or .
in a test case to test this branch, now that we don't handle -
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 yup will add test
@KSerrania @mx-psi mind giving another look? @james-bebbington would be keen to get this in before next release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We may want to add another test for NormalizeSpanKind
, since codecov complains about it (though I'm not sure why, I thought it was already run as part of other tests).
@james-bebbington any feedback here? just pinging as it's been a week, we'd be keen to get any feedback /get this merged before next release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I second Kylian's message about the normalization test
Hi all, I have opened another issue for naming. For us it is completely not readable and this PR is not helping so much. I suggest to switch completely to conform conventions. Thanks |
@ericmustin please fix the merge conflict. |
@tigrannajaryan updated, thanks |
**Description:** Adds a connection state reporter to the Jaeger exporter sending state changes to the log and as a metric. **Link to tracking Issue:** Closes #1861, as it's the best we can do at this exporter level. On a more general level, the collector could provide more verbose info about the underlying gRPC connections. See #2237 for more information. **Testing:** unit and manual tests. **Documentation:** None. Here are the complete logs for an OpenTelemetry Collector that got started without a Jaeger backend available. Note that the config.yaml contains two exporters, one (`jaeger`) with the `insecure: true` option, and a second one (`jaeger/2`) without this option. A Jaeger all-in-one is then started, without TLS support. This ends with the first exporter eventually transitioning to "READY", but the second won't. ``` 2020-12-02T11:17:26.116+0100 INFO service/service.go:409 Starting OpenTelemetry Collector... {"Version": "latest", "GitHash": "<NOT PROPERLY GENERATED>", "NumCPU": 12} 2020-12-02T11:17:26.116+0100 INFO service/service.go:253 Setting up own telemetry... 2020-12-02T11:17:26.130+0100 INFO service/telemetry.go:101 Serving Prometheus metrics {"address": "localhost:8888", "level": 0, "service.instance.id": "b4f3bc7c-2593-48e5-9ef9-8b585bbcf4fc"} 2020-12-02T11:17:26.131+0100 INFO service/service.go:290 Loading configuration... 2020-12-02T11:17:26.131+0100 INFO service/service.go:301 Applying configuration... 2020-12-02T11:17:26.131+0100 INFO service/service.go:322 Starting extensions... 2020-12-02T11:17:26.132+0100 INFO builder/exporters_builder.go:306 Exporter is enabled. {"component_kind": "exporter", "exporter": "jaeger"} 2020-12-02T11:17:26.132+0100 INFO builder/exporters_builder.go:306 Exporter is enabled. {"component_kind": "exporter", "exporter": "jaeger/2"} 2020-12-02T11:17:26.132+0100 INFO service/service.go:337 Starting exporters... 2020-12-02T11:17:26.132+0100 INFO builder/exporters_builder.go:92 Exporter is starting... {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger"} 2020-12-02T11:17:26.132+0100 INFO jaegerexporter/exporter.go:183 State of the connection with the Jaeger Collector backend {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger", "state": "CONNECTING"} 2020-12-02T11:17:26.132+0100 INFO builder/exporters_builder.go:97 Exporter started. {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger"} 2020-12-02T11:17:26.132+0100 INFO builder/exporters_builder.go:92 Exporter is starting... {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger/2"} 2020-12-02T11:17:26.132+0100 INFO jaegerexporter/exporter.go:183 State of the connection with the Jaeger Collector backend {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger/2", "state": "CONNECTING"} 2020-12-02T11:17:26.132+0100 INFO builder/exporters_builder.go:97 Exporter started. {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger/2"} 2020-12-02T11:17:26.132+0100 INFO builder/pipelines_builder.go:207 Pipeline is enabled. {"pipeline_name": "traces", "pipeline_datatype": "traces"} 2020-12-02T11:17:26.132+0100 INFO service/service.go:350 Starting processors... 2020-12-02T11:17:26.132+0100 INFO builder/pipelines_builder.go:51 Pipeline is starting... {"pipeline_name": "traces", "pipeline_datatype": "traces"} 2020-12-02T11:17:26.132+0100 INFO builder/pipelines_builder.go:61 Pipeline is started. {"pipeline_name": "traces", "pipeline_datatype": "traces"} 2020-12-02T11:17:26.132+0100 INFO builder/receivers_builder.go:235 Receiver is enabled. {"component_kind": "receiver", "component_type": "otlp", "component_name": "otlp", "datatype": "traces"} 2020-12-02T11:17:26.132+0100 INFO service/service.go:362 Starting receivers... 2020-12-02T11:17:26.132+0100 INFO builder/receivers_builder.go:70 Receiver is starting... {"component_kind": "receiver", "component_type": "otlp", "component_name": "otlp"} 2020-12-02T11:17:26.132+0100 INFO otlpreceiver/otlp.go:93 Starting GRPC server on endpoint 0.0.0.0:4317 {"component_kind": "receiver", "component_type": "otlp", "component_name": "otlp"} 2020-12-02T11:17:26.132+0100 INFO otlpreceiver/otlp.go:130 Setting up a second GRPC listener on legacy endpoint 0.0.0.0:55680 {"component_kind": "receiver", "component_type": "otlp", "component_name": "otlp"} 2020-12-02T11:17:26.132+0100 INFO otlpreceiver/otlp.go:93 Starting GRPC server on endpoint 0.0.0.0:55680 {"component_kind": "receiver", "component_type": "otlp", "component_name": "otlp"} 2020-12-02T11:17:26.132+0100 INFO builder/receivers_builder.go:75 Receiver started. {"component_kind": "receiver", "component_type": "otlp", "component_name": "otlp"} 2020-12-02T11:17:26.132+0100 INFO service/service.go:265 Everything is ready. Begin running and processing data. 2020-12-02T11:17:27.132+0100 INFO jaegerexporter/exporter.go:183 State of the connection with the Jaeger Collector backend {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger/2", "state": "TRANSIENT_FAILURE"} 2020-12-02T11:17:28.132+0100 INFO jaegerexporter/exporter.go:183 State of the connection with the Jaeger Collector backend {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger", "state": "TRANSIENT_FAILURE"} 2020-12-02T11:17:43.132+0100 INFO jaegerexporter/exporter.go:183 State of the connection with the Jaeger Collector backend {"component_kind": "exporter", "component_type": "jaeger", "component_name": "jaeger", "state": "READY"} ``` And here are the metrics for the final state: ``` # HELP otelcol_jaegerexporter_conn_state Last connection state: 0 = Idle, 1 = Connecting, 2 = Ready, 3 = TransientFailure, 4 = Shutdown # TYPE otelcol_jaegerexporter_conn_state gauge otelcol_jaegerexporter_conn_state{exporter_name="jaeger",service_instance_id="341f6179-0c34-4ad1-b2e5-19b2bed4c9d1"} 2 otelcol_jaegerexporter_conn_state{exporter_name="jaeger/2",service_instance_id="341f6179-0c34-4ad1-b2e5-19b2bed4c9d1"} 3 ``` Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Description:
This PR improves datadog trace translation in a few areas
Datadog Resource naming has improved to add more rich names for messaging spans (such a google pub sub) and grpc spans. GRPC spans will have resources sorted by
grpc.path
if possible, or<rpc.method> <rpc.service>
, and messaging spans will have resources sorted by<messaging.operation> <messaging.destination>
.Datadog span operation names will be shortened to only display
<instrumentation_library.name>.<span_kind>
. previously they were<instrumentation_library.name>.span_kind_<span_kind>
, which was not helpful extra info and was not displayed well in UI.Datadog span operation names will coerce
-
to_
. Previously the-
was being coerced to_
in some places in UI but not others, leading to an unusual experience, so just forcing it to_
regardless will resolve this issue.Link to tracking Issue:
n/a
Testing:
Updated Unit Tests