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

API: support metrics for prometheus.(#2899) #3189

Merged

Conversation

chundonglinlin
Copy link
Member

@chundonglinlin chundonglinlin commented Sep 24, 2022

Support metrics for Prometheus, Prometheus can call metrics, likely:

http://127.0.0.1:1985/metrics

Prometheus config:

scrape_configs:
    static_configs:
      - targets: ['127.0.0.1:1985']
        labels:
          group: '127.0.0.1:1985'

SRS config:


listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

exporter {
    # Whether exporter is enabled.
    # Overwrite by env SRS_EXPORTER_ENABLED
    # default: off
    enabled         on;
    # The logging label to category the cluster servers.
    # Overwrite by env SRS_EXPORTER_LABEL
    label cn-beijing;
    # The logging tag to category the cluster servers.
    # Overwrite by env SRS_EXPORTER_TAG
    tag cn-edge;
}

http_api {
    enabled         on;
    listen          1985;
}
vhost __defaultVhost__ {
}

@chundonglinlin chundonglinlin force-pushed the feature/support-metrics-for-prometheus branch from 13f5d3a to fbf6f4c Compare September 24, 2022 11:28
@winlinvip winlinvip merged commit 981cab4 into ossrs:develop Sep 27, 2022
johzzy pushed a commit to johzzy/srs that referenced this pull request Jun 26, 2023
* API: support metrics for prometheus.

* Metrics: optimize metrics statistics info.

* Refine: remove redundant code.

* Refine: fix metrics srs_streams param.

* Metrics: add major param.

* Metrics: refine params and metric comments.

* For ossrs#2899: API: Support exporter for Prometheus. v5.0.67

Co-authored-by: winlin <winlin@vip.126.com>
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants