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

Feat/179915 suport data tagging #183563

Merged
merged 28 commits into from
May 29, 2024

Conversation

kaanyalti
Copy link
Contributor

@kaanyalti kaanyalti commented May 15, 2024

Summary

This PR updates kibana backend so that users can add global data tags to agent policy inputs

Relates: #179915

Checklist

Delete any items that are not applicable to this PR.

For maintainers

Manual Testing

  • start elasticsearch and kibana
  • navigate to stack management and create an api key
  • download agent
  • create agent policy with system integration
  • update the agent to add data tags
curl --location --request PUT 'http://localhost:5601/api/fleet/agent_policies/:policyId' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey <your api key>' \
--header 'Elastic-Api-Version: 2023-10-31' \
--header 'kbn-xsrf: true' \
--data '{
    "name": "asdfasdf",
    "namespace": "default",
    "global_data_tags": [
        {
            "name": "newtag",
            "value": "testing"
        }
    ]
}'
  • deploy a standalone agent
  • go to the discovery tab and search for the tag name and validate that the values are populated. (note: seeing a value may take some time, 2~3 min)

@kaanyalti kaanyalti requested review from a team as code owners May 15, 2024 20:45
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label May 15, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kaanyalti kaanyalti marked this pull request as draft May 15, 2024 20:45
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@juliaElastic
Copy link
Contributor

juliaElastic commented May 16, 2024

you can run the build on a draft pr by commenting /ci

@juliaElastic
Copy link
Contributor

/ci

@kaanyalti kaanyalti force-pushed the feat/179915_suport_data_tagging branch from a59bd0f to a381253 Compare May 20, 2024 09:30
@kaanyalti kaanyalti marked this pull request as ready for review May 22, 2024 22:27
@kaanyalti kaanyalti requested a review from a team as a code owner May 22, 2024 22:27
@kaanyalti kaanyalti force-pushed the feat/179915_suport_data_tagging branch 2 times, most recently from 24bade0 to ea67e20 Compare May 23, 2024 06:27
@kaanyalti kaanyalti force-pushed the feat/179915_suport_data_tagging branch from 0b124db to ed4e3ee Compare May 23, 2024 06:56
@kibanamachine kibanamachine requested a review from a team as a code owner May 23, 2024 07:34
@kaanyalti kaanyalti force-pushed the feat/179915_suport_data_tagging branch from e7b981b to 93b384a Compare May 28, 2024 16:13
@kaanyalti kaanyalti removed request for a team May 28, 2024 16:13
@kaanyalti kaanyalti disabled auto-merge May 28, 2024 16:25
@kaanyalti kaanyalti enabled auto-merge (squash) May 28, 2024 16:25
@kaanyalti kaanyalti disabled auto-merge May 28, 2024 16:25
@kibana-ci
Copy link
Collaborator

kibana-ci commented May 28, 2024

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1189 1191 +2

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5412 +5412
total size - 8.8MB +8.8MB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
fleet 66 68 +2

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 165.1KB 165.4KB +256.0B
Unknown metric groups

API count

id before after diff
fleet 1310 1312 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kaanyalti kaanyalti enabled auto-merge (squash) May 28, 2024 21:24
@juliaElastic juliaElastic requested a review from a team May 29, 2024 05:52
@kaanyalti kaanyalti merged commit 957e134 into elastic:main May 29, 2024
22 checks passed
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels May 29, 2024
rshen91 pushed a commit to rshen91/kibana that referenced this pull request May 30, 2024
## Summary

This PR updates kibana backend so that users can add global data tags to
agent policy inputs

Relates: elastic#179915

### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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/packages/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
- [x] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Manual Testing
- start elasticsearch and kibana 
- navigate to stack management and create an api key
- download agent
- create agent policy with system integration
- update the agent to add data tags
```
curl --location --request PUT 'http://localhost:5601/api/fleet/agent_policies/:policyId' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey <your api key>' \
--header 'Elastic-Api-Version: 2023-10-31' \
--header 'kbn-xsrf: true' \
--data '{
    "name": "asdfasdf",
    "namespace": "default",
    "global_data_tags": [
        {
            "name": "newtag",
            "value": "testing"
        }
    ]
}'
```
- deploy a standalone agent
- go to the discovery tab and search for the tag name and validate that
the values are populated. (note: seeing a value may take some time, 2~3
min)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet