[OpAMP] parse comma separated tags list from non-identifying attributes#6769
Open
juliaElastic wants to merge 3 commits intoelastic:mainfrom
Open
[OpAMP] parse comma separated tags list from non-identifying attributes#6769juliaElastic wants to merge 3 commits intoelastic:mainfrom
juliaElastic wants to merge 3 commits intoelastic:mainfrom
Conversation
Contributor
|
This pull request does not have a backport label. Could you fix it @juliaElastic? 🙏
|
juliaElastic
commented
Apr 8, 2026
| }, | ||
| { | ||
| name: "multiple tags", | ||
| tagsValue: "dev,west,us-west-1a", |
Contributor
Author
There was a problem hiding this comment.
using a comma separated list, when tested with an array in the otel config yaml, I was getting an error in the otel collector
tags: ["prod", "west", "us-west-1a"]
'extensions' error reading configuration for "opamp": decoding failed due to the following error(s):
'agent_description.non_identifying_attributes[tags]' expected type 'string', got unconvertible type '[]interface {}'
'service.telemetry.resource[tags]' expected type 'string', got unconvertible type '[]interface {}'
10 tasks
juliaElastic
added a commit
to elastic/kibana
that referenced
this pull request
Apr 9, 2026
## Summary Relates elastic/ingest-dev#7062 Added new mappings in elastic/elasticsearch#145824 to kibana so the UI search works on them. To verify: Start ES from source with so the new mappings apply (switch to the branch of the ES PR): ``` yarn es source --license trial -E xpack.security.authc.api_key.enabled=true -E xpack.security.authc.token.enabled=true --source-path=/Users/juliabardi/elasticsearch -E path.data=/tmp/es-data -E xpack.ml.enabled=false -E http.host=0.0.0.0 ``` Add a collector (follow steps in elastic/fleet-server#6769) and test that the UI search works on the new fields: <img width="952" height="505" alt="image" src="https://github.com/user-attachments/assets/d776f8cd-3367-4f35-a3fa-deee5b211292" /> <img width="949" height="498" alt="image" src="https://github.com/user-attachments/assets/7045e502-0484-4cc6-937b-c878bbbead29" /> <img width="888" height="492" alt="image" src="https://github.com/user-attachments/assets/9971b2b6-acdb-474e-a3c2-a68e54779cd6" /> <img width="840" height="515" alt="image" src="https://github.com/user-attachments/assets/dd8da6c6-e546-4eef-ad43-b85cd6dae7c6" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
10 tasks
ycombinator
reviewed
Apr 11, 2026
| tagsValue: " dev , west , us-west-1a ", | ||
| wantTags: []string{"otel-collector", "dev", "west", "us-west-1a"}, | ||
| otherNIAKeys: []string{string(semconv.HostNameKey)}, | ||
| }, |
Contributor
There was a problem hiding this comment.
I think we should add a test case for duplicate tags, e.g. "west,dev,west". These should probably be deduplicated so the wantTags is []string{"west","dev"}. I can't imagine a use case for storing duplicates?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the problem this PR solves?
Save tags list in the top level tags field in Agent, taking from the comma separated list from non-identifying attributes
How does this PR solve the problem?
Non-identifying attributes are already added to Agent, tags need special handling because they are mapped to the top level tags field, and the comma separated string has to be parsed.
How to test this PR locally
Follow instructions in https://github.com/elastic/fleet-server/blob/main/docs/opamp.md
Download and extract otel collector, e.g.:
Create otel config to include the new metadata fields, e.g.
otel-opamp.yaml:Create API keys and start otel collector:
Check the Agent JSON in Fleet, check that tags are showing up as an array, and
non_identifying_attributesshow the new metadata fields.Check the telemetry data in Discover, and find the matching fields in
resource.attributes:Tested ESQL queries on the new fields in telemetry:
Open question:
tagsfield in collector telemetry data is not parsed to a list of strings, I'm not sure how can we fix that. The collector config doesn't accept a list, only string."tags": "dev,west,us-west-1a"Design Checklist
Checklist
./changelog/fragmentsusing the changelog toolRelated issues