Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Conductor server metrics how/help + prometheus #1811

Closed
eins opened this issue Jul 28, 2020 · 6 comments
Closed

Conductor server metrics how/help + prometheus #1811

eins opened this issue Jul 28, 2020 · 6 comments
Labels

Comments

@eins
Copy link

eins commented Jul 28, 2020

Hello guys
I read a few tickets about conductor server and prometheus metrics

#600
#1769

And the conductor documentation
https://netflix.github.io/conductor/metrics/server/

But I can't understand how to enable spectator in conductor server and
then push metrics to a external prometheus server.

https://netflix.github.io/conductor/metrics/server/#publishing-metrics

Conductor uses spectator to collect the metrics.

  • To enable conductor serve to publish metrics, add this dependency to
    your build.gradle.

    is build.grade, server/build.gradle ?

    I followed the link and I tried to add

      // metrics -- this line didn't work
     compile "com.netflix.spectator:spectator-reg-metrics3:0.89.0"
    

    or https://github.com/brharrington/spectator-examples/blob/master/metrics3/build.gradle

    I had errors

    A problem occurred configuring project ':conductor-server'.

    Could not resolve all dependencies for configuration ':conductor-server:runtimeCopy'.
    Could not find com.netflix.spectator:spectator-reg-metrics3:0.89.0.

    OR

    Could not get unknown property 'version_guice' for object of type
    org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Conductor Server enables you to load additional modules dynamically,
    this feature can be controlled using this configuration.

    I added to docker/server/config/config.properties

    # Additional modules for metrics collection (optional)
    conductor.additional.modules=com.netflix.conductor.contribs.metrics.MetricsRegistryModule,com.netflix.conductor.contribs.metrics.LoggingMetricsModule
    com.netflix.conductor.contribs.metrics.LoggingMetricsModule.reportPeriodSeconds=15
    
  • Create your own AbstractModule that overides configure function and
    registers the Spectator metrics registry.

  • Initialize the Registry and add it to the global registry via
    ((CompositeRegistry)Spectator.globalRegistry()).add(...).

the last two option I don't know where I need to add it.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2021

This issue is stale, because it has been open for 45 days with no activity. Remove the stale label or comment, or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 7, 2021
@github-actions
Copy link
Contributor

This issue was closed, because it has been stalled for 7 days with no activity.

@marcocrasso
Copy link
Contributor

marcocrasso commented Apr 16, 2021

@eins today I faced the same problem and a Web search brings me here. In case you still want to achieve this, I'd suggest to:

for development purposes:

in server/build.gradle file add:

implementation 'org.springframework.boot:spring-boot-starter-actuator'

in server/src/main/resources/application.properties add:

conductor.metrics-prometheus.enabled=true
management.endpoints.web.exposure.include=prometheus,health,info,metrics

** EDITED **
in java/com/netflix/conductor/contribs/metrics/PrometheusMetricsConfiguration.java

Remove the instantiation of Prometheus registry, and let Spring inject the actuator one:

public PrometheusMetricsConfiguration(MeterRegistry meterRegistry) {
    LOGGER.info("Prometheus metrics module initialized");

    final MicrometerRegistry metricsRegistry = new MicrometerRegistry(meterRegistry);

then hit at root:

./gradlew server

visit: http://localhost:8080/actuator and follow the links.

for PRD

For production, build a docker image with the change in server/build.gradle and then configure your container as showed.

@marcocrasso
Copy link
Contributor

By the way, the source I consulted:

  1. Sections 1 and 2 (only the first two sentences) of : https://micrometer.io/docs/registry/prometheus#_installing
  2. https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-endpoints-exposing-endpoints

@eins
Copy link
Author

eins commented Aug 18, 2021

@marcocrasso thanks for the reply on this ticket. We moved to camundabpm . conductor was to green .

@yashwant-mv
Copy link

@marcocrasso anyway we can achieve this using configs and using docker images?

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

No branches or pull requests

3 participants