elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.61k stars 8.22k forks source link

[APM] OTel Agent names not recognized correctly after a change in mapping #180444

Closed AlexanderWert closed 1 month ago

AlexanderWert commented 7 months ago

Kibana version: 8.13 +

Describe the bug: With https://github.com/elastic/apm-data/pull/203 the field agent.name for OTel data got an additional suffix. For example, for Java OTel, before the name was always: opentelemetry/java. With the above change, we now can differentiate different distributions of the OTel SDKs / agents, resulting in agent names like:

(Note: The above is not Java specific, but a general change for all languages).

With that change the APM UI broke in terms of not being able to recognize the Agent icon and additional OpenTelemetry meta-information anymore:

Before:

image

After:

service-metadata-for-elastic-distros
elasticmachine commented 7 months ago

Pinging @elastic/apm-ui (Team:APM)

elasticmachine commented 7 months ago

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

smith commented 7 months ago

We have some stories with agent icons under ServiceLink but maybe we should add a complete list of examples we would expect similar to what we have for span icons: https://ci-artifacts.kibana.dev/storybooks/main/00a637c8ce0d33df6a12b40a6ab6c765afaf440d/apm/index.html?path=/story/shared-spanicon--list

I believe all the client-side logic for dealing with agent names is in this package: https://github.com/elastic/kibana/blob/a6a6823d284fc0ca63ef362612750b0d97ebf30d/packages/kbn-elastic-agent-utils/src/agent_names.ts

SylvainJuge commented 7 months ago

From what I found with the java agent with https://github.com/elastic/kibana/pull/180574 it is only impacting users of the 2.x versions that provide the telemetry.* attributes, with 1.x java agent versions the otel and java badges are properly shown.

rogercoll commented 3 months ago

Reopening this issue because the https://github.com/elastic/kibana/pull/180574/files PR seems to fix Java agents only. Dotnet, PHP and Node.js seems to be not recognized yet:

image image

I think a more generic option would be to skip/remove any prefix (e.g opentelemetry/) from the agent name check.

smith commented 2 months ago

We'll take another look at this to make sure we're covering all the cases.

IMO the best solution would to use telemetry.sdk and process.runtime OpenTelemetry fields directly as the inputs for the function that returns an icon for a service. I don't know which of these attributes we currently have.

rogercoll commented 2 months ago

It seems that for some APM only fails the Elastic's distributions, .NET example:

rmyz commented 1 month ago

Hi team, I've created https://github.com/elastic/kibana/pull/193134 which will solve the issue regarding the icon.

I've also noticed that we are receiving a malformed language under OpenTelemetry details:

Image

This info is fetched by GET /internal/apm/services/{serviceName}/metadata/details on this file, should we change anything here as well?

AlexanderWert commented 1 month ago

This info is fetched by GET /internal/apm/services/{serviceName}/metadata/details on this file, should we change anything here as well?

@rmyz Yes, let's please fix everything related to agent name that broke with the change of the name.