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

[Profiling] Switch to OTEL cloud.provider, cloud.region, host.type #106656

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

rockdaboot
Copy link
Contributor

Description

The profiling agent is going to be donated to OTEL.

We currently don't have an own field for the provider name and derive the provider name from other existing fields. The OTEL semantic conventions suggest to use cloud.provider as field name.

We currently don't have an own field for the cloud region and check different provider-specific fields for the region. For some providers, this even requires string parsing.
Ideally, the host agent sends the normalized values as cloud.region. This would be in sync with the OTEL semantic conventions.

We currently don't have an own field for the cloud instance type and check different provider-specific fields. For some providers, this even requires string parsing.
Ideally, the host agent sends the normalized values as host.type. This would be in sync with the OTEL semantic conventions.

Fixes #106625

@rockdaboot rockdaboot added >enhancement :UniversalProfiling/Application Elastic Universal Profiling REST APIs and infrastructure Team:obs-knowledge Meta label for Observability Knowledge team v8.14.0 labels Mar 22, 2024
@rockdaboot rockdaboot self-assigned this Mar 22, 2024
@elasticsearchmachine elasticsearchmachine added the external-contributor Pull request authored by a developer outside the Elasticsearch team label Mar 22, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/obs-knowledge-team (Team:obs-knowledge)


// history for individual indices / index templates. Only bump these for breaking changes that require to create a new index
public static final int PROFILING_EVENTS_VERSION = 2;
public static final int PROFILING_EXECUTABLES_VERSION = 1;
public static final int PROFILING_METRICS_VERSION = 1;
public static final int PROFILING_HOSTS_VERSION = 1;
public static final int PROFILING_HOSTS_VERSION = 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided for a roll-over since it's easier to argue about changes to be done in the collector.

Copy link
Member

@danielmitterdorfer danielmitterdorfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one remark about the index template version number, otherwise it looks fine.

@@ -47,13 +47,14 @@ public class ProfilingIndexTemplateRegistry extends IndexTemplateRegistry {
// version 4: Added 'service.name' keyword mapping to profiling-events
// version 5: Add optional component template '<idx-name>@custom' to all index templates that reference component templates
// version 6: Added 'host.arch' keyword mapping to profiling-hosts
public static final int INDEX_TEMPLATE_VERSION = 6;
// version 7: Added 'host.type', 'cloud.provider', 'cloud.region' keyword mappings to profiling-hosts
public static final int INDEX_TEMPLATE_VERSION = 7;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this in the last review but it is actually not required that we bump the index template version on every change. Instead, it is sufficient to bump it once per release because no cluster can observe the intermediate index template versions.

Long story short: Can you please change this value to 5 (which applies to 8.14.0) and merge the comments accordingly to include all changes that went into version 5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point I already thought of. My conclusion was that I do not know whether version 5 or 6 has already been deployed (locally) and used by developers. And if you don't know that, why risking to break things even if it is just one or two people?

What is the downside of increasing the version several times per release cycle?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, it's less risky to bump the version all the time, even if this means version jumps between releases (which are harmless) so let's stick to this convention in the future.

@danielmitterdorfer danielmitterdorfer self-requested a review March 22, 2024 14:50
Copy link
Member

@danielmitterdorfer danielmitterdorfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rockdaboot
Copy link
Contributor Author

cc @christos68k FYA

@rockdaboot rockdaboot merged commit 0eca8dd into elastic:main Mar 22, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement external-contributor Pull request authored by a developer outside the Elasticsearch team Team:obs-knowledge Meta label for Observability Knowledge team :UniversalProfiling/Application Elastic Universal Profiling REST APIs and infrastructure v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Profiling] Introduce OTEL cloud.provider, cloud.region, host.type
3 participants