Skip to content

Ocyss/srs-auth / .agents/skills/internal-docs-for-srs

internal-docs-for-srs

Flagged

Route SRS and Oryx tasks to the smallest relevant set of trusted project documentation and maintain the project documentation bundled with this skill. Use whenever support or development work requires locating, choosing, reading, creating, updating, or reviewing SRS documentation, or whenever Oryx work requires project documentation for deployment, streaming, authentication, recording to local or S3-compatible storage, restreaming, virtual live, camera, transcoding, HTTPS, APIs, callbacks, AI features, or development. Includes the C++ media server documentation, Oryx project documentation, website pages, changelog, executable API examples, and next-generation Go server and performance documentation.

FileKindSize
SKILL.mdskill md12.2 KB
references/cpp-docs/doc/dvr.mdmarkdown11.3 KB
references/cpp-docs/doc/edge.mdmarkdown6.0 KB
references/cpp-docs/doc/exporter.mdmarkdown5.3 KB
references/cpp-docs/doc/ffmpeg.mdmarkdown13.1 KB
references/cpp-docs/doc/flv.mdmarkdown13.3 KB
references/cpp-docs/doc/forward.mdmarkdown8.3 KB
references/cpp-docs/doc/gb28181.mdmarkdown2.2 KB
references/cpp-docs/doc/getting-started-ai.mdmarkdown5.9 KB
references/cpp-docs/doc/getting-started-build.mdmarkdown5.3 KB
references/cpp-docs/doc/getting-started-cdk.mdmarkdown264 B
references/cpp-docs/doc/getting-started.mdmarkdown6.7 KB
references/cpp-docs/doc/hevc.mdmarkdown18.4 KB
references/cpp-docs/doc/hls.mdmarkdown34.8 KB
references/cpp-docs/doc/http-api.mdmarkdown18.4 KB
references/cpp-docs/doc/http-callback.mdmarkdown16.5 KB
references/cpp-docs/doc/http-server.mdmarkdown9.5 KB
references/cpp-docs/doc/ingest.mdmarkdown3.3 KB
references/cpp-docs/doc/introduction.mdmarkdown11.4 KB
references/cpp-docs/doc/low-latency.mdmarkdown6.5 KB
references/cpp-docs/doc/nginx-for-hls.mdmarkdown10.8 KB
references/cpp-docs/doc/origin-cluster.mdmarkdown18.5 KB
references/cpp-docs/doc/performance.mdmarkdown26.8 KB
references/cpp-docs/doc/resource.mdmarkdown3.4 KB
references/cpp-docs/doc/rtmp.mdmarkdown18.6 KB
references/cpp-docs/doc/rtsp.mdmarkdown7.3 KB
references/cpp-docs/doc/security.mdmarkdown2.0 KB
references/cpp-docs/doc/snapshot.mdmarkdown3.6 KB
references/cpp-docs/doc/srt.mdmarkdown29.1 KB
references/cpp-docs/doc/webrtc.mdmarkdown34.0 KB
references/cpp-docs/pages/faq-server-en.mdmarkdown31.0 KB
references/cpp-docs/pages/license-en.mdmarkdown6.8 KB
references/cpp-docs/pages/product-en.mdmarkdown25.7 KB
references/cpp-docs/pages/security-advisories-en.mdmarkdown1.4 KB
references/oryx/2022-04-09-Oryx-Tutorial.mdmarkdown14.2 KB
references/oryx/2022-04-12-Oryx-HTTPS.mdmarkdown5.0 KB
references/oryx/2022-04-15-Oryx-WordPress-Plugin.mdmarkdown4.9 KB
references/oryx/2022-04-29-BT-aaPanel.mdmarkdown5.6 KB
references/oryx/2023-08-29-Oryx-Ensuring-Authentication-for-Live-Streaming-Publishing.mdmarkdown6.2 KB
references/oryx/2023-09-09-Oryx-Multi-Platform-Streaming.mdmarkdown4.9 KB
references/oryx/2023-09-10-Oryx-Record-Live-Streaming.mdmarkdown4.5 KB
references/oryx/2023-09-11-Oryx-Virtual-Live-Events.mdmarkdown6.0 KB
references/oryx/2023-10-11-Oryx-Stream-IP-Camera-Events.mdmarkdown5.3 KB
references/oryx/2023-10-21-Oryx-Live-Transcoding.mdmarkdown5.4 KB
references/oryx/2023-11-28-Oryx-Live-Streams-Transcription.mdmarkdown5.4 KB
references/oryx/2023-12-12-Oryx-OBS-WHIP-Service.mdmarkdown4.5 KB
references/oryx/2024-01-31-Browser-Voice-Driven-GPT.mdmarkdown9.5 KB
references/oryx/2024-02-21-Dubbing-Translating.mdmarkdown5.0 KB
references/oryx/2024-05-20-OCR-Video-Streams.mdmarkdown4.3 KB
references/oryx/faq-oryx-en.mdmarkdown37.0 KB
references/oryx/getting-started-oryx.mdmarkdown15.9 KB
references/perf/proxy-whep.mdmarkdown5.4 KB
references/proxy/features.mdmarkdown9.3 KB
references/proxy/proxy-design.mdmarkdown2.8 KB
references/proxy/proxy-load-balancer.mdmarkdown5.8 KB
references/proxy/proxy-origin-cluster.mdmarkdown5.7 KB
references/proxy/proxy-protocol.mdmarkdown5.8 KB
references/proxy/proxy-usage.mdmarkdown2.7 KB

references/cpp-docs/doc/exporter.md

View on GitHub
---
title: Prometheus Exporter
sidebar_label: Exporter
hide_title: false
hide_table_of_contents: false
---

# Prometheus Exporter

The observability of SRS is about metrics(Prometheus Exporter), tracing(APM) and logging(Cloud Logging). 

## Introduction

For detail specs, please read [OpenTelemetry](https://opentelemetry.io/docs/concepts/observability-primer).

![](/img/doc-2022-10-30-001.png)

> Note: Please see [Metrics, tracing, and logging](https://peter.bourgon.org/blog/2017/02/21/metrics-tracing-and-logging.html)

The architecture for Prometheus exporter:

```
+-----+               +-----------+     +---------+
| SRS +--Exporter-->--| Promethus +-->--+ Grafana +
+-----+   (HTTP)      +-----------+     +---------+
```

There is special config for exporter.

## Config

The config for exporter is bellow. Highly recommend using environment variables to enable it:

```bash
# Prometheus exporter config.
# See https://prometheus.io/docs/instrumenting/exporters
exporter {
    # Whether exporter is enabled.
    # Overwrite by env SRS_EXPORTER_ENABLED
    # Default: off
    enabled off;
    # The http api listen port for exporter metrics.
    # Overwrite by env SRS_EXPORTER_LISTEN
    # Default: 9972
    # See https://github.com/prometheus/prometheus/wiki/Default-port-allocations
    listen 9972;
    # 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;
}
```

Let's start SRS exporter to export metrics to Prometheus.

## Usage for SRS Exporter

Build and start `SRS 5.0.86+`:

```bash
./configure && make
env SRS_ENV_ONLY=on SRS_EXPORTER_ENABLED=on SRS_LISTEN=1935 \
  ./objs/srs -e
```

> Note: We use envrionment variables to config SRS, without config file. However, you're able to use config file `conf/prometheus.conf` to start the demo.

> Note: Please open [http://localhost:9972/metrics](http://localhost:9972/metrics) to verify SRS.

Then, use FFmpeg to push a live stream to SRS:

```bash
docker run --rm -it ossrs/srs:encoder ffmpeg -re -i doc/source.flv -c copy \
  -f flv rtmp://host.docker.internal/live/livestream
```

Next, run [node_exporter](https://github.com/prometheus/node_exporter) to collect the node data:

```bash
docker run --rm -p 9100:9100 prom/node-exporter
```

> Note: Highly recommend downloading from [here](https://github.com/prometheus/node_exporter/releases) and startting by binary file.

> Note: Please open [http://localhost:9100/metrics](http://localhost:9100/metrics) to verify it.

Finally, create a `prometheus.yml` for prometheus:

```yml
scrape_configs:
  - job_name: "node"
    metrics_path: "/metrics"
    scrape_interval: 5s
    static_configs:
      - targets: ["host.docker.internal:9100"]
  - job_name: "srs"
    metrics_path: "/metrics"
    scrape_interval: 5s
    static_configs:
      - targets: ["host.docker.internal:9972"]
```

> Note: We set the `scrape_interval` to `5s`, which is default to `1m` or one minute.

Start Prometheus by:

```bash
docker run --rm -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
  -p 9090:9090 prom/prometheus
```

Please ope [Prometheus: Targets](http://localhost:9090/targets), or [Prometheus: Graph](http://localhost:9090/graph) to query the input bitrate:

```sql
rate(srs_receive_bytes_total[10s])*8
```

This query is used to query the input bitrate, which is the bitrate of stream:

![](/img/doc-2022-10-30-002.png)

Normally we use Grafana to render the graph.

## Usage for Grafana

First, start Grafana in docker:

```bash
docker run --rm -it -p 3000:3000 \
  -e GF_SECURITY_ADMIN_USER=admin \
  -e GF_SECURITY_ADMIN_PASSWORD=12345678 \
  -e GF_USERS_DEFAULT_THEME=light \
  grafana/grafana
```

Please access Grafana console by [http://localhost:3000/](http://localhost:3000/)

> Note: Please input username `admin` and password `12345678` then click login.

Run command to [add](https://grafana.com/docs/grafana/latest/developers/http_api/data_source/#create-a-data-source) a Prometheus DataSource:

```bash
curl -s -H "Content-Type: application/json" \
    -XPOST http://admin:12345678@localhost:3000/api/datasources \
    -d '{
    "name": "prometheus",
    "type": "prometheus",
    "access": "proxy", "isDefault": true,
    "url": "http://host.docker.internal:9090"
}'
```

Run command to [import](https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/#create--update-dashboard) the HelloWorld dashboard:

```bash
data=$(curl https://raw.githubusercontent.com/ossrs/srs-grafana/main/dashboards/helloworld-import.json 2>/dev/null)
curl -s -H "Content-Type: application/json" \
    -XPOST http://admin:12345678@localhost:3000/api/dashboards/db \
    --data-binary "{\"dashboard\":${data},\"overwrite\":true,\"inputs\":[],\"folderId\":0}"
```

> Note: For other dashboards, please see [srs-grafana](https://github.com/ossrs/srs-grafana/tree/main/dashboards).

Then open [Dashboards](http://localhost:3000/dashboards) in browser, you will see the imported dashboard:

![](/img/doc-2022-10-30-003.png)

There are more other dashboards, please get them in [srs-grafana](https://github.com/ossrs/srs-grafana/tree/main/dashboards). 

![](/img/doc-2022-10-30-004.png)

Any patch is welcome.

![](https://ossrs.io/gif/v1/sls.gif?site=ossrs.io&path=/lts/doc/en/v7/exporter)

writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall