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

Add a period parameter to the counter cache in remote write #9424

Merged
merged 9 commits into from
Apr 2, 2024

Conversation

gizas
Copy link
Contributor

@gizas gizas commented Mar 22, 2024

  • Bug

Proposed commit message

  • WHAT: Added period parameter for counter cache in remote write dataset of prometheus
  • WHY: The rate calculation of counter metrics in Prometheus remote_write dataset was reporting zero values

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.

How to test this PR locally

  1. Checkout this branch
  2. cd packages/prometheus
  3. Run elastic-package build command
  4. Initiate a new Elastic cluster elastic-package stack up -d -v --version=8.14.0-SNAPSHOT
  5. Login to Kibana and install Prometheus Assets
  6. Install prometheus server with remote write in your kubernetes cluster
  7. Configure elastic-agent
inputs:
    - name: prometheus
      type: prometheus/metrics
      use_output: default
      meta:
        package:
          name: prometheus
          version: 1.15.1
      data_stream:
        namespace: default
      streams:
        - data_stream:
            dataset: prometheus.remote_write
            type: metrics
          metricsets:
            - remote_write
          host: '0.0.0.0'
          port: 9201
          rate_counters: true
          use_types: true
          period: 1m

Related issues

Screenshots

For my local kubernetes cluster (40m evidence for correct rate calculation with elastic-agent-standalone manifest)

Screenshot 2024-03-22 at 12 02 13 PM

Copy link
Collaborator

@lalit-satapathy lalit-satapathy left a comment

Choose a reason for hiding this comment

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

LGTM.

packages/prometheus/changelog.yml Outdated Show resolved Hide resolved
packages/prometheus/data_stream/remote_write/manifest.yml Outdated Show resolved Hide resolved
packages/prometheus/changelog.yml Outdated Show resolved Hide resolved
@shmsr shmsr changed the title Adding period parameter for counter cache in remote write Add a period parameterto the counter cache in remote write Mar 25, 2024
@shmsr shmsr added the bug Something isn't working label Mar 25, 2024
@shmsr shmsr changed the title Add a period parameterto the counter cache in remote write Add a period parameter to the counter cache in remote write Mar 25, 2024
Copy link
Contributor

@tetianakravchenko tetianakravchenko left a comment

Choose a reason for hiding this comment

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

LGTM!

gizas and others added 2 commits March 27, 2024 10:58
Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
@gizas gizas enabled auto-merge (squash) March 27, 2024 09:24
@gizas gizas disabled auto-merge March 27, 2024 09:24
@gizas
Copy link
Contributor Author

gizas commented Mar 27, 2024

@shmsr let me know if is ok now and we can merge this

Copy link
Contributor

@ishleenk17 ishleenk17 left a comment

Choose a reason for hiding this comment

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

Looks good!

@gizas gizas requested a review from shmsr March 28, 2024 07:52
@elasticmachine
Copy link

💚 Build Succeeded

History

Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

@gizas gizas merged commit b25b576 into main Apr 2, 2024
5 checks passed
@gizas gizas deleted the remote_write_ratefix branch April 2, 2024 08:57
@elasticmachine
Copy link

Package prometheus - 1.15.1 containing this change is available at https://epr.elastic.co/search?package=prometheus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants