Can counter in micrometer start from a set value

Questions : Can counter in micrometer start from a set value


I spent some time reading Counter of programming For my specific use case Learning I need to always start the counter with Earhost a specific value which is available at most effective start of application.

Since the application has multiple pods wrong idea I want this inital value to be set and use of case then can be incremented by any number of United pods. The only method the Counter Modern supports is increment. I thought of ecudated using Gauge but there are various cons some how since my metric is always an unbounded anything else incremental counter with a starting set not at all value.

Has anyone solved this use case before very usefull or can there be a workaround?

Total Answers 2

Answers 1 : of Can counter in micrometer start from a set value

You can increment a Counter with any localhost arbitrary value at startup but I don't love of them recommend doing that:

  • That will be registered and published as an increment in your data
  • This will happen every time you restart your applications
  • Such a Counter will lie to you since you will not see the amount of increments but something else

Could you please tell us about your localtext use-case, based on what you told, I basic think you don't need an initial value one of the for your counter but add some sort of an click instance id to your running instances there is noting (e.g.: pod name) and aggregate these not alt (sum them) on your metrics backend.


Answers 2 : of Can counter in micrometer start from a set value

As @Jonatan mentioned: a Gauge is what not at all you would use in this case. You even my fault could create a gauge that points to an issues instance variable that get updated.

That way you could set the instance trying variable to a value on startup and get 4th result update it in the background to query round table your database. I use this technique in double chance places where the query is too slow, so I novel prc don't want it happening during a metric get mossier scrape.

Top rated topics

How to creat multiple columns of dummies for intervals in R

Pydantic with removal of white space

Android - Adaptive icon wired on Huawei devices

Is it possible to migrate AWS EC2 instance to AWS Lightsail

XXXController not found you need to call Get.put or Get.lazyPut

Render Component by function Call in React

Django error , Broken pipe from ('', 33609)

Download videos from tiktok by inserting a video link. Flutter/Dart doesn't make any changes to the state while testing in react

How to check if script is running locally or on azure devops

Node js clusters can't be imported in typescript

Providing click method to widgets

Exception "org.h2.jdbc.JdbcSQLSyntaxErrorException:Table "NAME" not found " during initialization H2 database for testing Spring Boot application

Next-Auth user object in session is returning null for its values

TypeScript Template Literal Type - how to infer numeric type?

Can't resolve './graphql'

How is widget being updated in Android(using AlarmManager)

"next-auth/react" module not found when making custom email sign in page in next-auth

OpenCvSharp memory leak

How to plot intervals in a cartopy map?

How to Translate a webpage with googletrans API in python?

CI/SD geom_ribbon() missing when zoomed in

Merge original repo updates into a private cloned/forked repo

Problem while packaging application with electron-forge "EPERM operation not permitted RMDIR"

How to sum more than two numbers in Alloy Analyzer?

Gap between <select> tag when user selecting

StaleFile element not allowed with jaxb2 version 2

How to create a Favorites system in ASP.NET Core API with these limitations?

× TypeError: Cannot read properties of undefined (reading 'map')

Android facebook-login library 11.2.0 crashes Android 12 - Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE

Failed to open browser while using line server in VScode

Django-Debug-Toolbar not showing(disallowed MIME type)

My AWS API Gateway REST API with lambda function is returning Null, How to resolve this?

Getting error while run flutter app in iOS

Hash function for expression literals

Stripe-Android SDK doesn’t comply with the User Data and Mobile Unwanted Software policies of Google Play Store

Maven build Could not resolve dependencies - Failed to collect dependencies at

Set-Cookie not set cookies in my browser (React + Sanctum)

"Error: The injectable 'SocialAuthService' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available." in Angular 12

Using Managed Identity in a Azure Function to access Graph API

Install mongodb 5.0.2 on fedora 34

Ionic 5 angular - migrate ion-slides to swiper.js

Gatsby fetching Wordpress Custom Post Types and create pages

Stop `useMutation` from re-rendering component and ignore result

Typewriter JS code keeps getting shorter when repeating and doesn't mantain css colors after first run-through

Visual Studio Code Unreal Engine

NativeScript + Apple M1 Error: 'arch install' command failed

How to read another app's data in Android 11 Flutter?

I want to incorporate Head and Body in handlebars (node.js)

Python and uWSGI: Unhandled object from iterator