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 server/pid/service label for exporter and api. #3385

Merged

Conversation

chundonglinlin
Copy link
Member

1.Use Prometheus Exporter, a server, pid and service label will be added to srs_build_info, for example:

# HELP srs_build_info A metric with a constant '1' value labeled by build_date, version from which SRS was built.
# TYPE srs_build_info gauge
srs_build_info{server="vid-90759d6",service="28d8h44y49",pid="19957",build_date="2023-01-17 07:33:00",major="5",version="5.0.134",code="Bee",label="cn-beijing",tag="cn-edge"} 1

2.Each API response, should return pid and service, for example, http://localhost:1985/api/v1/versions:

{
    "code": 0, 
    "server": "vid-90759d6", 
    "service": "28d8h44y49", 
    "pid": "19957", 
    "data": {
        "major": 5, 
        "minor": 0, 
        "revision": 134, 
        "version": "5.0.134"
    }
}

@chundonglinlin chundonglinlin changed the title API: Support server/pid/service label for exporter. API: Support server/pid/service label for exporter and api. Jan 17, 2023
trunk/src/app/srs_app_statistic.cpp Outdated Show resolved Hide resolved
winlinvip
winlinvip previously approved these changes Jan 17, 2023
@winlinvip winlinvip dismissed stale reviews from duiniuluantanqin and themself via 277198d January 17, 2023 10:13
@winlinvip winlinvip force-pushed the feature/exporter-add-build-info branch from 8900ebf to 277198d Compare January 17, 2023 10:13
@winlinvip winlinvip changed the base branch from 5.0release to develop January 17, 2023 10:13
@winlinvip winlinvip merged commit 02653ce into ossrs:develop Jan 17, 2023
winlinvip added a commit that referenced this pull request Jan 17, 2023
* Exporter: Support server/pid/service.(#3378)
* API: Support return server/pid/service.(#3378)
* Use 8-length service id.
* Update release v5.0.135 v6.0.16

PICK 02653ce

Co-authored-by: winlin <[email protected]>
Co-authored-by: Haibo Chen <[email protected]>
@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.

API: The server_id does not change even when restarted. 服务重启 server ID 标识没有改变
3 participants