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

Enforce single config for APM agent service/env in API #57018

Closed
graphaelli opened this issue Feb 6, 2020 · 3 comments · Fixed by #57767
Closed

Enforce single config for APM agent service/env in API #57018

graphaelli opened this issue Feb 6, 2020 · 3 comments · Fixed by #57767
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support

Comments

@graphaelli
Copy link
Member

graphaelli commented Feb 6, 2020

Kibana version: 7.x

Describe the bug: Multiple configurations for the same service/environment in APM agent configuration can be created.

Steps to reproduce:

  1. curl 'http://admin:XXX@localhost:5601/api/apm/settings/agent-configuration/new' -H 'Accept: */*' -H 'kbn-version: 7.6.0' -H 'Content-Type: application/json' --data '{"service":{},"settings":{"transaction_sample_rate":1,"capture_body":"off","transaction_max_spans":500}}'
  2. curl 'http://admin:XXX@localhost:5601/api/apm/settings/agent-configuration/new' -H 'Accept: */*' -H 'kbn-version: 7.6.0' -H 'Content-Type: application/json' --data '{"service":{},"settings":{"transaction_sample_rate":1,"capture_body":"off","transaction_max_spans":500}}'

Expected behavior:

2nd call should fail.

Screenshots (if relevant):

image

related to #57005

@graphaelli graphaelli added bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support labels Feb 6, 2020
@elasticmachine
Copy link
Contributor

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

@sorenlouv
Copy link
Member

sorenlouv commented Feb 17, 2020

@graphaelli How would you like subsequent request to be handled if the configuration already exists?

I see a few options:

  1. Subsequent requests will return a 409 Conflict if the configuration already exists. By supplying the query param ?overwrite=true subsequent requests will update the existing configuration.

  2. Subsequent request will overwrite the existing configuration unless ?overwrite=false is supplied.

I went for option 1. I'm wondering option 2 is better. Or it should be something third?

@sorenlouv
Copy link
Member

Another option is to not have an overwrite flag at all, and always upsert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants