MCPcopy Index your code
hub / github.com/exaring/openconfig-streaming-telemetry-exporter

github.com/exaring/openconfig-streaming-telemetry-exporter @1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.1 ↗ · + Follow
302 symbols 472 edges 14 files 53 documented · 18% updated 4y ago1.0.1 · 2021-03-25★ 441 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

openconfig-streaming-telemetry-exporter

openconfig-streaming-telemetry-exporter is a Prometheus exporter that collects metrics from network devices using streaming telemetry.

Tested with: - JunOS 17.3. and 18.3 on QFX10k - JunOS 18.2 on MX (with JunOS openconfig package) - JunOS 20.2 on MX - JunOS 20.2 on ACX5448-M

Known issues:

  • JunOS 20.2 on ACX5448-M: Interface metrics are not sent by the ACX

Build Status Coverage Status Go ReportCard Go Doc

PRs for other systems welcome!

Install

go get github.com/exaring/openconfig-streaming-telemetry-exporter

Run

openconfig-streaming-telemetry-exporter -config.file /path/to/config.yml

Configuration

# The address to listen for Prometheus scrapers
listen_address: 0.0.0.0:9513
# Prometheus metrics path
metrics_path: /metrics
# Targets block, you can define multiple targets here
targets:
# Hostname of the openconfig target
- hostname: 203.0.113.1
  # Port of the openconfig target
  port: 50051
  # GRPC keepalive in seconds
  keepalive_s: 1
  # GRPC timeout in seconds
  timeout_s: 3
  # Openconfig paths to subscribe to
  paths:
    # Network interfaces metrics path
  - path: /interfaces/
    # Suppress updates for not changed metrics
    suppress_unchanged: false
    # Maximum time between updates
    max_silent_interval_ms: 20000
    # Sample frequency
    sample_frequency_ms: 2000
# As some metrics are returned as strings we need to map those to an int for Prometheus
string_value_mapping:
  # Path to do mappings for
  /interfaces/interface/state/oper-status:
    # string(DOWN) mapped to int(0)
    DOWN: 0
    # string(UP) mapped to int(1)
    UP: 1

JunOS examples

Device Configuration

https://forums.juniper.net/t5/Automation/OpenConfig-and-gRPC-Junos-Telemetry-Interface/ta-p/316090

Available openconfig paths

https://www.juniper.net/documentation/en_US/junos/topics/reference/general/junos-telemetry-interface-grpc-sensors.html
https://www.juniper.net/documentation/en_US/junos/information-products/pathway-pages/open-config/open-config-feature-guide.pdf

Debug

If you want to see the internal tree structure you should visit /debug/dump. General status information is available under /debug/state.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

newTree
called by 8
pkg/collector/tree.go
newNode
called by 4
pkg/collector/tree.go
insert
called by 4
pkg/collector/tree.go
setDescription
called by 3
pkg/collector/tree.go
getMetrics
called by 3
pkg/collector/tree.go
pathToIdentifiers
called by 3
pkg/collector/tree.go
pathElementToIdentifier
called by 3
pkg/collector/tree.go
Serve
called by 3
pkg/collector/target.go

Shape

Method 205
Function 45
Struct 44
Interface 5
TypeAlias 3

Languages

Go100%

Modules by API surface

pkg/telemetry/telemetry.pb.go206 symbols
pkg/collector/tree.go22 symbols
pkg/collector/collector_test.go14 symbols
pkg/collector/target.go10 symbols
pkg/collector/collector.go9 symbols
pkg/collector/metric.go8 symbols
pkg/frontend/frontend.go6 symbols
pkg/config/config.go6 symbols
pkg/collector/tree_test.go5 symbols
pkg/collector/metric_set.go4 symbols
pkg/collector/id_cache.go4 symbols
main.go4 symbols

For agents

$ claude mcp add openconfig-streaming-telemetry-exporter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page