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

Use elastic create operation instead of index #2997

Merged
merged 3 commits into from
Feb 16, 2022

Conversation

jeremyross
Copy link
Contributor

@jeremyross jeremyross commented Feb 6, 2022

create makes more sense and allows micrometer to write to elastic data streams.

Closes #2996

@pivotal-cla
Copy link

@jeremyross Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@jeremyross Thank you for signing the Contributor License Agreement!

@shakuzen
Copy link
Member

shakuzen commented Feb 7, 2022

Is this a breaking change for users not using data streams?

@jeremyross
Copy link
Contributor Author

No, it's completely transparent. I've tested this change with indexes and data streams. The index name specified can be an index or a data stream. And if no index or data stream exists, elastic will create one and the matching index template determines whether an index or data stream is created.

@shakuzen
Copy link
Member

I don't know why the CI wasn't run for this pull request, but unit tests need to be updated for this change. They are failing now.

@shakuzen shakuzen linked an issue Feb 16, 2022 that may be closed by this pull request
@shakuzen shakuzen merged commit c25fefa into micrometer-metrics:main Feb 16, 2022
@patpatpat123
Copy link

patpatpat123 commented Apr 11, 2023

Hello @jeremyross ,

Hope this message finds you well.
First of all, if not anything else, big thanks for this PR!

I took the latest builds of micrometer, from 1.10 all the way to the latest milestone.
I cross-tested with Elastic cluster from 7.6, all the way to the latest 8.7.

I am observing the following: those are facts and observations:

  • test case 1: with this change, if the index already exists, and is of type plain index, micrometer will publish the metrics inside this plain index.
  • test case 2: with this change, if the index already exists, and is of type data stream, micrometer will publish the metrics inside this data stream.
  • test case 3: with this change, if the index does not already exist, meaning the index does not even exist in the first place, neither plain index, neither data stream, micrometer will publish the metrics, and a plain index will be created.

Above, for test cases 1, 2, and 3, by plain index, I mean this: (please see screenshot)

Screenshot 2023-04-11 163814

and by data stream I mean this (please see screenshot)

Screenshot 2023-04-11 163729

(small nota, your change is great for test case 2. Without your/this change, test case 2 would fail, I just verified)

Just wanted to confirm with you this is your expectation for the above test cases.

I am reaching out because for test 3, an expected enhancement/feature would be:

if the index does not already exist, meaning the index does not even exist in the first place, neither plain index, neither data stream, micrometer will publish the metrics, and a time series data stream will be created, that would be a great feature.

What do you think?

Finally, would you mind sharing the data stream index template for the micrometer metrics please?

Thank you for your time reading me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support writing to elastic data streams
4 participants