Skip to content

[elasticsearch] Extension of the Elasticsearch integration with datastream-centric stats#11656

Merged
3kt merged 0 commit intoelastic:mainfrom
3kt:monitoring_consumption
Jan 7, 2025
Merged

[elasticsearch] Extension of the Elasticsearch integration with datastream-centric stats#11656
3kt merged 0 commit intoelastic:mainfrom
3kt:monitoring_consumption

Conversation

@3kt
Copy link
Contributor

@3kt 3kt commented Nov 7, 2024

Proposed commit message

This adds a couple new assets to the elasticsearch integration (which natively aims to monitor Elasticsearch clusters):

  • A transform job that pivots index stats (either provided by this same integration, or previously shipped with Metricbeat).
  • An ingest pipeline that cleans up the documents created by the transform job.
  • A dashboard consuming the resulting data to provide datastream and tier centric consumption information.

This aims to provide stack-native capabilities that are otherwise fulfilled through custom scripting (known as "consumption framework" within Elastic).

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Requires multiple dependencies:

Screenshots

indices_datastream_view

@3kt 3kt added the enhancement New feature or request label Nov 7, 2024
@andrewkroh andrewkroh added dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:elasticsearch Elasticsearch labels Nov 7, 2024
@3kt 3kt marked this pull request as ready for review December 21, 2024 20:42
@3kt 3kt requested a review from a team as a code owner December 21, 2024 20:42
@3kt 3kt requested a review from consulthys December 21, 2024 20:44
@andrewkroh andrewkroh added the Team:Stack Monitoring Stack Monitoring team [elastic/stack-monitoring] label Dec 21, 2024
Copy link
Contributor

@consulthys consulthys left a comment

Choose a reason for hiding this comment

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

Fantastic job!! Here are a few initial comments.

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elastic-sonarqube
Copy link

@elasticmachine
Copy link

💚 Build Succeeded

History

  • 💔 Build #20063 failed fbd122eda5e1bcf097c07bf0ee2272e5e15e3332
  • 💔 Build #20059 failed 6f8db89434d9b1fa15541158a55626d5b2d97642
  • 💔 Build #20051 failed 62fbe72df38e7705e82377c7c28db112c6146afb
  • 💔 Build #20046 failed 3d261174a2172a468f1aff3808434f6330b70720
  • 💔 Build #20015 failed 6f31e48a5c6ee086e05c715a7e5678aae4c587ad

@3kt 3kt requested review from a team and consulthys January 7, 2025 12:22
Copy link
Contributor

@consulthys consulthys left a comment

Choose a reason for hiding this comment

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

LGT Stack Monitoring

@3kt 3kt merged commit ad70926 into elastic:main Jan 7, 2025
@3kt 3kt deleted the monitoring_consumption branch January 7, 2025 15:35
@elastic-vault-github-plugin-prod

Package elasticsearch - 1.16.0 containing this change is available at https://epr.elastic.co/package/elasticsearch/1.16.0/

@IanLee1521
Copy link
Contributor

IanLee1521 commented Jan 9, 2025

Hi there! I've been using the tech preview dashboards for Elasticsearch for a bit now, and think this will be huge, I was literally making a transform for myself yesterday to try to create a latest index of stats that I could use for my indices (but ran into a bug and had to pause to open a support ticket).

A question as I just updated the Elasticsearch integration to add these new assets.. It looks like the new transform (logs-elasticsearch.index_pivot-default-0.1.0 ) did not start automatically. Is that expected? Is it normal to have to go and manually start up the transforms when integrations update and add this new functionality? -- Looking forward to getting this data available and useable for our monitoring!

@consulthys
Copy link
Contributor

@IanLee1521 Thanks for your feedback!
Yes, it is on purpose as explained in the integration documentation

This transform isn’t started by default (Stack management > Transforms), but will perform the following once activated:

@3kt can probably fill you in on why it was decided to do it that way.

@3kt
Copy link
Contributor Author

3kt commented Jan 9, 2025

hi @IanLee1521, thanks for the feedback!

did not start automatically. Is that expected?

Yes - until we take the dashboards out of tech preview, I'd rather they have to be explicitly enabled by the users. I've tested performance and impact on large scale clusters, but I'm keen on getting wider field feedback.

The dashboard mentions that the transform has to be enabled manually, and gives a direct link to stack management for this purpose.

Also bear in mind that the full feature set will only be available once 8.17.1 hits, once this is live.

@IanLee1521
Copy link
Contributor

@3kt - Happy to provide feedback! The short version for me at this point is that the target transform index (monitoring-indices) is not being populated. I thought it might just take a bit, but I gave it a few hours, and still nothing, despite no errors on the transform itself:

image

Happy to communicate in an appropriate venue (I'm in the Elastic Community Slack) to discuss what might be going on.

@IanLee1521
Copy link
Contributor

The dashboard mentions that the transform has to be enabled manually, and gives a direct link to stack management for this purpose.

Just want to say that after I posted here I did find that message on the dashboard, I just hadn't seen it when first loading things.

@consulthys
Copy link
Contributor

@IanLee1521

The short version for me at this point is that the target transform index (monitoring-indices) is not being populated. I thought it might just take a bit, but I gave it a few hours, and still nothing, despite no errors on the transform itself:

As mentioned by @3kt this is only going to work once Metricbeat 8.17.1 gets released.

@IanLee1521
Copy link
Contributor

Thank you yes, 3kt pointed that out separately that I'd missed that line in their message. Looking forward to reporting back once that is out!

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
@amemkdm
Copy link

amemkdm commented Feb 10, 2025

@3kt Just tried this and its looks great, the only thing is I am not able to see the elasticsearch.index.age field being populated in the index created by the transform. I also checked the transform configuration and couldn't find any transforms which would populate the field, so is this something which is still not added in the current version? Due to this the cosumption part of the dashboard is not getting filled. I have upgraded all the components to 8.17.1, we have a self managed on prem cluster.
image

@3kt
Copy link
Contributor Author

3kt commented Feb 10, 2025

hi @amemkdm, can you check if your documents have the elasticsearch.index.creation_date field set properly?
You will need to filter on event.dataset: elasticsearch.index or event.dataset: elasticsearch.stack_monitoring.index, depending on your collection mean.

The elasticsearch.index.age field is generated by a script in the ingest pipeline. Having a document to test for would allow me to check if there's any bug there :)

        ZonedDateTime currentDate = ZonedDateTime.parse(ctx['@timestamp']);
        ZonedDateTime creationDate = ZonedDateTime.parse(ctx.elasticsearch.index.creation_date);
        long ageInMillis = ChronoUnit.MILLIS.between(creationDate, currentDate);
        ctx.elasticsearch.index.age = (ageInMillis / (1000 * 60 * 60 * 24)).intValue();

Side note, you can hit me up on the community Slack if you have an account there - my name is the same as in my Github profile ;)

@amemkdm
Copy link

amemkdm commented Feb 11, 2025

Done. I have reached out to you on Slack.

@andrewkroh andrewkroh removed Integration:elasticsearch Elasticsearch dashboard Relates to a Kibana dashboard bug, enhancement, or modification. labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Team:Stack Monitoring Stack Monitoring team [elastic/stack-monitoring]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants