spring-projects / spring-data-cassandra

Provides support to increase developer productivity in Java when using Apache Cassandra. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-cassandra/
Apache License 2.0
373 stars 307 forks source link

Allow configuration of `CassandraObservationConvention` #1490

Open divyagangigunta123 opened 2 months ago

divyagangigunta123 commented 2 months ago

Hi Team,

I have integrated my spring boot application with cassandra observability. Have configured it and able to push low cardinality metrices to prometheus. But unable to push high cardinality keys to prometheus with the existing code base.

What all changes need to be done to push high cardinality keys as well ? or Can I convert high cardinality key to low cardinality key and push metrices to prometheus ?

Can you please allow wiring to CassandraObservationConvention interface ?

Regards, Divya.G

mp911de commented 2 months ago

CassandraObservationConvention is deeply buried in CqlSessionObservationInterceptor and ObservableReactiveSession. Currently, there's no external access available to configure the convention.

We would need a configuration mechanism instead of passing on all the individual parts as method or constructor arguments.

divyagangigunta123 commented 2 months ago

Can you please let me know how we can add configuration mechanism for assandraObservationConvention ?

mp911de commented 2 months ago

Since all classes are package-private, there's nothing you could do except for duplicating our code into your codebase and applying the desired changes there.

divyagangigunta123 commented 2 months ago

Can you please let me know in which class only low cardinality keys are getting picked ? So, that will duplicate that codebase and modify accordingly for db.statement to be picked under low cardinality keys.

divyagangigunta123 commented 2 months ago

Can you please let me know which class need to be overridden and how to allow db.statement into low cardinality ? This will be helpful if you can please suggest on this