openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
189 stars 57 forks source link

Output port open, but no data to scrape #343

Closed tsmjay closed 10 months ago

tsmjay commented 10 months ago

Hi,

If I subscribe to updates from a particular metric, it appears that the gNMIc 'output' port is opened, but there is no data to scrape.

Output from a working metric:

[test@arch-1 ~]$ gnmic -d --config /usr/local/etc/gnmic-3.yaml subscribe
2024/01/09 13:20:32.620959 /home/runner/work/gnmic/gnmic/pkg/app/app.go:223: [gnmic] version=0.34.3, commit=d461fa9, date=2023-11-14T02:13:11Z, gitURL=https://github.com/openconfig/gnmic, docs=https://gnmic.openconfig.net
2024/01/09 13:20:32.620997 /home/runner/work/gnmic/gnmic/pkg/app/app.go:228: [gnmic] using config file "/usr/local/etc/gnmic-3.yaml"
2024/01/09 13:20:32.624116 /home/runner/work/gnmic/gnmic/pkg/app/app.go:266: [gnmic] set flags/config:
address: []
api: ""
auth-scheme: ""
calculate-latency: false
capabilities-version: false
cluster-name: default-cluster
config: /usr/local/etc/gnmic-3.yaml
debug: true
diff-compare: []
diff-model: []
diff-path: []
diff-prefix: ""
diff-qos: "0"
diff-ref: ""
diff-set-to-notifs-full: false
diff-set-to-notifs-response: ""
diff-set-to-notifs-setrequest: ""
diff-setrequest-full: false
diff-setrequest-new: ""
diff-setrequest-ref: ""
diff-sub: false
diff-target: ""
diff-type: ALL
dir: []
encoding: json_ietf
exclude: []
file: []
format: ""
generate-camel-case: false
generate-config-only: false
generate-path: ""
generate-snake-case: false
get-model: []
get-path: []
get-prefix: ""
get-processor: []
get-target: ""
get-type: ALL
get-values-only: false
getset-condition: any([true])
getset-delete: ""
getset-get: ""
getset-model: []
getset-prefix: ""
getset-replace: ""
getset-target: ""
getset-type: ALL
getset-update: ""
getset-value: ""
gzip: false
insecure: false
instance-name: ""
listen-max-concurrent-streams: "256"
listen-prometheus-address: ""
log: true
log-file: ""
log-tls-secret: false
max-msg-size: 536870912
no-prefix: false
outputs:
  prometheus:
    debug: true
    listen: :9804
    path: /metrics
    type: prometheus
password: ""
path-config-only: false
path-descr: false
path-path-type: xpath
path-search: false
path-state-only: false
path-types: false
path-with-non-leaves: false
path-with-prefix: false
port: "57400"
print-request: false
prompt-description-bg-color: dark_gray
prompt-description-with-prefix: false
prompt-description-with-types: false
prompt-max-suggestions: "10"
prompt-prefix-color: dark_blue
prompt-suggest-all-flags: false
prompt-suggest-with-origin: false
prompt-suggestions-bg-color: dark_blue
proto-dir: []
proto-file: []
proxy-from-env: false
retry: 10s
set-delete: []
set-delimiter: ':::'
set-dry-run: false
set-prefix: ""
set-replace: []
set-replace-cli: []
set-replace-cli-file: ""
set-replace-file: []
set-replace-path: []
set-replace-value: []
set-request-file: []
set-request-replace: []
set-request-update: []
set-request-vars: ""
set-target: ""
set-union-replace: []
set-union-replace-file: []
set-union-replace-path: []
set-union-replace-value: []
set-update: []
set-update-cli: []
set-update-cli-file: ""
set-update-file: []
set-update-path: []
set-update-value: []
skip-verify: false
subscribe-backoff: 0s
subscribe-heartbeat-interval: 0s
subscribe-history-end: ""
subscribe-history-snapshot: ""
subscribe-history-start: ""
subscribe-lock-retry: 5s
subscribe-mode: stream
subscribe-model: []
subscribe-name: []
subscribe-output: []
subscribe-path: []
subscribe-prefix: ""
subscribe-qos: "0"
subscribe-quiet: false
subscribe-sample-interval: 0s
subscribe-set-target: false
subscribe-stream-mode: target-defined
subscribe-suppress-redundant: false
subscribe-target: ""
subscribe-updates-only: false
subscribe-watch-config: false
subscriptions:
  stream-sample:
    mode: stream
    paths:
    - /openconfig-system:system/cpus
    sample-interval: 30s
    stream-mode: sample
targets:
  172.16.1.3:8080:
    password: test123
    skip-verify: true
    username: admin
targets-file: ""
timeout: 10s
tls-ca: ""
tls-cert: ""
tls-key: ""
tls-max-version: ""
tls-min-version: ""
tls-server-name: ""
tls-version: ""
token: ""
upgrade-use-pkg: false
use-tunnel-server: false
username: ""

2024/01/09 13:20:32.624533 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] config='/usr/local/etc/gnmic-3.yaml'(string)
2024/01/09 13:20:32.624549 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] debug='true'(bool)
2024/01/09 13:20:32.624567 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] encoding='json_ietf'(string)
2024/01/09 13:20:32.624968 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/debug='true'(bool)
2024/01/09 13:20:32.625358 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/listen=':9804'(string)
2024/01/09 13:20:32.625721 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/path='/metrics'(string)
2024/01/09 13:20:32.626110 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/type='prometheus'(string)
2024/01/09 13:20:32.626533 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-sample/mode='stream'(string)
2024/01/09 13:20:32.626901 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-sample/paths='[/openconfig-system:system/cpus]'([]interface {})
2024/01/09 13:20:32.627259 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-sample/sample-interval='30s'(string)
2024/01/09 13:20:32.627638 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-sample/stream-mode='sample'(string)
2024/01/09 13:20:32.628002 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] targets/172.16.1.3:8080/password='test123'(string)
2024/01/09 13:20:32.628380 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] targets/172.16.1.3:8080/skip-verify='true'(bool)
2024/01/09 13:20:32.628742 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] targets/172.16.1.3:8080/username='admin'(string)
2024/01/09 13:20:32.628837 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=backoff, changed=false, isSetInFile=false
2024/01/09 13:20:32.628880 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=heartbeat-interval, changed=false, isSetInFile=false
2024/01/09 13:20:32.628906 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=help, changed=false, isSetInFile=false
2024/01/09 13:20:32.628912 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=history-end, changed=false, isSetInFile=false
2024/01/09 13:20:32.628967 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=history-snapshot, changed=false, isSetInFile=false
2024/01/09 13:20:32.629050 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=history-start, changed=false, isSetInFile=false
2024/01/09 13:20:32.629171 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=lock-retry, changed=false, isSetInFile=false
2024/01/09 13:20:32.629230 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=mode, changed=false, isSetInFile=false
2024/01/09 13:20:32.629302 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=model, changed=false, isSetInFile=false
2024/01/09 13:20:32.629401 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=name, changed=false, isSetInFile=false
2024/01/09 13:20:32.629460 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=output, changed=false, isSetInFile=false
2024/01/09 13:20:32.629518 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=path, changed=false, isSetInFile=false
2024/01/09 13:20:32.629576 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=prefix, changed=false, isSetInFile=false
2024/01/09 13:20:32.629635 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=qos, changed=false, isSetInFile=false
2024/01/09 13:20:32.629694 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=quiet, changed=false, isSetInFile=false
2024/01/09 13:20:32.629716 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=sample-interval, changed=false, isSetInFile=false
2024/01/09 13:20:32.629805 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=set-target, changed=false, isSetInFile=false
2024/01/09 13:20:32.629828 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=stream-mode, changed=false, isSetInFile=false
2024/01/09 13:20:32.629964 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=suppress-redundant, changed=false, isSetInFile=false
2024/01/09 13:20:32.630024 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=target, changed=false, isSetInFile=false
2024/01/09 13:20:32.630083 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=updates-only, changed=false, isSetInFile=false
2024/01/09 13:20:32.630140 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=watch-config, changed=false, isSetInFile=false
2024/01/09 13:20:32.630275 /home/runner/work/gnmic/gnmic/pkg/config/subscriptions.go:48: [config] subscriptions map: map[string]interface {}{"stream-sample":map[string]interface {}{"mode":"stream", "paths":[]interface {}{"/openconfig-system:system/cpus"}, "sample-interval":"30s", "stream-mode":"sample"}}
1 {"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}
2 {"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}
3 {"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}
2024/01/09 13:20:32.630623 /home/runner/work/gnmic/gnmic/pkg/config/subscriptions.go:67: [config] subscriptions: map[stream-sample:{"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}]
2024/01/09 13:20:32.630784 /home/runner/work/gnmic/gnmic/pkg/config/outputs.go:61: [config] outputs: map[prometheus:map[debug:true format: listen::9804 path:/metrics type:prometheus]]
2024/01/09 13:20:32.630821 /home/runner/work/gnmic/gnmic/pkg/config/inputs.go:57: [config] inputs: map[]
2024/01/09 13:20:32.630960 /home/runner/work/gnmic/gnmic/pkg/config/actions.go:49: [config] actions: map[]
2024/01/09 13:20:32.631020 /home/runner/work/gnmic/gnmic/pkg/config/processors.go:45: [config] processors: map[]
2024/01/09 13:20:32.631139 /home/runner/work/gnmic/gnmic/pkg/config/targets.go:102: [config] read target config: {"name":"172.16.1.3:8080","address":"172.16.1.3:8080","username":"admin","password":"****","timeout":10000000000,"insecure":false,"tls-cert":"","tls-key":"","skip-verify":true,"buffer-size":100,"retry-timer":10000000000,"log-tls-secret":false,"gzip":false,"token":""}
2024/01/09 13:20:32.631418 /home/runner/work/gnmic/gnmic/pkg/config/targets.go:124: [config] targets: map[172.16.1.3:8080:{"name":"172.16.1.3:8080","address":"172.16.1.3:8080","username":"admin","password":"****","timeout":10000000000,"insecure":false,"tls-cert":"","tls-key":"","skip-verify":true,"buffer-size":100,"retry-timer":10000000000,"log-tls-secret":false,"gzip":false,"token":""}]
2024/01/09 13:20:32.631453 /home/runner/work/gnmic/gnmic/pkg/app/outputs.go:27: [gnmic] starting output type prometheus
2024/01/09 13:20:32.631558 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:75: [gnmic] queuing target "172.16.1.3:8080"
2024/01/09 13:20:32.631572 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:77: [gnmic] subscribing to target: "172.16.1.3:8080"
2024/01/09 13:20:32.631614 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:42: [gnmic] starting target &{Config:{"name":"172.16.1.3:8080","address":"172.16.1.3:8080","username":"admin","password":"****","timeout":10000000000,"insecure":false,"tls-cert":"","tls-key":"","skip-verify":true,"buffer-size":100,"retry-timer":10000000000,"log-tls-secret":false,"gzip":false,"token":""} Subscriptions:map[stream-sample:{"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}] m:0xc00070bd20 conn:<nil> Client:<nil> SubscribeClients:map[] subscribeCancelFn:map[] pollChan:0xc000a50120 subscribeResponses:0xc0007fccc0 errors:0xc0007fcd20 stopped:false StopChan:0xc000a50180 Cfn:<nil> RootDesc:<nil>}
2024/01/09 13:20:32.631779 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:60: [gnmic] starting target "172.16.1.3:8080" listener
2024/01/09 13:20:32.631984 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel created
2024/01/09 13:20:32.632031 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] original dial target is: "172.16.1.3:8080"
2024/01/09 13:20:32.632050 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] dial target "172.16.1.3:8080" parse failed: parse "172.16.1.3:8080": first path segment in URL cannot contain colon
2024/01/09 13:20:32.632073 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] fallback to scheme "passthrough"
2024/01/09 13:20:32.632099 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] parsed dial target is: {URL:{Scheme:passthrough Opaque: User: Host: Path:/172.16.1.3:8080 RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2024/01/09 13:20:32.632127 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel authority set to "172.16.1.3:8080"
2024/01/09 13:20:32.632273 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Resolver state updated: {
  "Addresses": [
    {
      "Addr": "172.16.1.3:8080",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Metadata": null
    }
  ],
  "Endpoints": [
    {
      "Addresses": [
        {
          "Addr": "172.16.1.3:8080",
          "ServerName": "",
          "Attributes": null,
          "BalancerAttributes": null,
          "Metadata": null
        }
      ],
      "Attributes": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)
2024/01/09 13:20:32.632545 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel switches to new LB policy "pick_first"
2024/01/09 13:20:32.632569 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:273: [prometheus_output:prometheus] initialized prometheus output: {"name":"prometheus","listen":":9804","path":"/metrics","expiration":60000000000,"debug":true,"timeout":10000000000,"num-workers":1}
2024/01/09 13:20:32.632661 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [pick-first-lb 0xc0006f6690] Received new config {
  "shuffleAddressList": false
}, resolver state {
  "Addresses": [
    {
      "Addr": "172.16.1.3:8080",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Metadata": null
    }
  ],
  "Endpoints": [
    {
      "Addresses": [
        {
          "Addr": "172.16.1.3:8080",
          "ServerName": "",
          "Attributes": null,
          "BalancerAttributes": null,
          "Metadata": null
        }
      ],
      "Attributes": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
}
2024/01/09 13:20:32.632779 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel created
2024/01/09 13:20:32.632840 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel Connectivity change to CONNECTING
2024/01/09 13:20:32.632970 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING
2024/01/09 13:20:32.632998 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel picks a new address "172.16.1.3:8080" to connect
2024/01/09 13:20:32.633102 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [pick-first-lb 0xc0006f6690] Received SubConn state update: 0xc0006f6c60, {ConnectivityState:CONNECTING ConnectionError:<nil>}
2024/01/09 13:20:32.655699 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY
2024/01/09 13:20:32.655816 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [pick-first-lb 0xc0006f6690] Received SubConn state update: 0xc0006f6c60, {ConnectivityState:READY ConnectionError:<nil>}
2024/01/09 13:20:32.655838 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel Connectivity change to READY
2024/01/09 13:20:32.655885 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:220: [gnmic] target "172.16.1.3:8080" gNMI client created
2024/01/09 13:20:32.655973 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:223: [gnmic] sending gNMI SubscribeRequest: subscribe='subscribe:{subscription:{path:{elem:{name:"openconfig-system:system"} elem:{name:"cpus"}} mode:SAMPLE sample_interval:30000000000} encoding:JSON_IETF}', mode='STREAM', encoding='JSON_IETF', to 172.16.1.3:8080
2024/01/09 13:20:32.698682 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-sample SubscriptionConfig:{"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:update:{timestamp:1704777633094273969 prefix:{elem:{name:"openconfig-system:system"}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"index"}} val:{uint_val:0}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:14}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"index"}} val:{uint_val:1}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:14}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:15}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:10}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"index"}} val:{uint_val:2}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}}}}
2024/01/09 13:20:32.698943 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-sample SubscriptionConfig:{"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:sync_response:true}
2024/01/09 13:20:32.699046 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:20:32.699214 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=10448693330169184761, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:20:32.699187109 +0800 CST m=+0.118336841
2024/01/09 13:20:32.699263 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":0}}
2024/01/09 13:20:32.699302 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=1129647258922676094, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=0.000000,time=nil,addedAt=2024-01-09 13:20:32.69928552 +0800 CST m=+0.118435259
2024/01/09 13:20:32.699390 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:20:32.699426 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9438956315090224966, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:20:32.699416836 +0800 CST m=+0.118566571
2024/01/09 13:20:32.699442 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":14}}
2024/01/09 13:20:32.699515 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=16875950039623173897, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=14.000000,time=nil,addedAt=2024-01-09 13:20:32.699475171 +0800 CST m=+0.118624908
2024/01/09 13:20:32.699560 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:20:32.699645 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=17954654362136118179, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:20:32.699631154 +0800 CST m=+0.118780888
2024/01/09 13:20:32.699686 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":1}}
2024/01/09 13:20:32.699724 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=6542854036166583201, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=1.000000,time=nil,addedAt=2024-01-09 13:20:32.69971151 +0800 CST m=+0.118861245
2024/01/09 13:20:32.699772 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":14}}
2024/01/09 13:20:32.699805 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9082557441403925670, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=14.000000,time=nil,addedAt=2024-01-09 13:20:32.699795314 +0800 CST m=+0.118945046
2024/01/09 13:20:32.699869 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":15}}
2024/01/09 13:20:32.699908 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=13944315331769520307, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=15.000000,time=nil,addedAt=2024-01-09 13:20:32.699894888 +0800 CST m=+0.119044621
2024/01/09 13:20:32.699950 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:20:32.699997 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=6940938159925040041, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:20:32.699977805 +0800 CST m=+0.119127538
2024/01/09 13:20:32.700042 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":10}}
2024/01/09 13:20:32.700097 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=15662214335732753008, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=10.000000,time=nil,addedAt=2024-01-09 13:20:32.700070452 +0800 CST m=+0.119220185
2024/01/09 13:20:32.700147 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":2}}
2024/01/09 13:20:32.700194 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9231366635998035096, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=2.000000,time=nil,addedAt=2024-01-09 13:20:32.700173047 +0800 CST m=+0.119322780
2024/01/09 13:20:32.700276 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777633094273969,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:20:32.700311 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=3178098174351140256, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:20:32.700299252 +0800 CST m=+0.119448986
2024/01/09 13:21:02.712099 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-sample SubscriptionConfig:{"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:update:{timestamp:1704777663101136071 prefix:{elem:{name:"openconfig-system:system"}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"index"}} val:{uint_val:0}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:15}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"index"}} val:{uint_val:1}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:15}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"index"}} val:{uint_val:2}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:15}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} delete:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}}} delete:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}}} delete:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}}}}}
2024/01/09 13:21:02.713296 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":0}}
2024/01/09 13:21:02.713617 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=1129647258922676094, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=0.000000,time=nil,addedAt=2024-01-09 13:21:02.713491566 +0800 CST m=+30.132641394
2024/01/09 13:21:02.713746 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:21:02.713959 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9438956315090224966, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:21:02.713889993 +0800 CST m=+30.133039813
2024/01/09 13:21:02.714116 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":15}}
2024/01/09 13:21:02.714373 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=16875950039623173897, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=15.000000,time=nil,addedAt=2024-01-09 13:21:02.714336847 +0800 CST m=+30.133486669
2024/01/09 13:21:02.714663 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:21:02.714804 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=17954654362136118179, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:21:02.714757086 +0800 CST m=+30.133906904
2024/01/09 13:21:02.715045 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":1}}
2024/01/09 13:21:02.715271 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=6542854036166583201, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=1.000000,time=nil,addedAt=2024-01-09 13:21:02.715220219 +0800 CST m=+30.134370043
2024/01/09 13:21:02.715501 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:21:02.715693 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=6940938159925040041, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:21:02.715628908 +0800 CST m=+30.134778726
2024/01/09 13:21:02.715876 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":15}}
2024/01/09 13:21:02.716070 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9082557441403925670, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=15.000000,time=nil,addedAt=2024-01-09 13:21:02.716002831 +0800 CST m=+30.135153417
2024/01/09 13:21:02.716145 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:21:02.716302 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=15662214335732753008, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:21:02.716250588 +0800 CST m=+30.135400410
2024/01/09 13:21:02.716400 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":2}}
2024/01/09 13:21:02.716623 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9231366635998035096, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=2.000000,time=nil,addedAt=2024-01-09 13:21:02.716483053 +0800 CST m=+30.135632879
2024/01/09 13:21:02.716744 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:21:02.716884 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=3178098174351140256, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:21:02.716823825 +0800 CST m=+30.135973654
2024/01/09 13:21:02.717033 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":15}}
2024/01/09 13:21:02.717460 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=13944315331769520307, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=15.000000,time=nil,addedAt=2024-01-09 13:21:02.717390717 +0800 CST m=+30.136540541
2024/01/09 13:21:02.717612 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:21:02.717867 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=10448693330169184761, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:21:02.717775295 +0800 CST m=+30.136925113
2024/01/09 13:21:02.718076 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777663101136071,"tags":{"source":"172.16.1.3:8080","subscription-name":"stream-sample"},"deletes":["cpus/cpu[index=0]","cpus/cpu[index=1]","cpus/cpu[index=2]"]}
2024/01/09 13:21:32.714306 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-sample SubscriptionConfig:{"name":"stream-sample","paths":["/openconfig-system:system/cpus"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:update:{timestamp:1704777693101711229 prefix:{elem:{name:"openconfig-system:system"}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"index"}} val:{uint_val:0}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:15}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"index"}} val:{uint_val:1}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:15}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"index"}} val:{uint_val:2}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"idle"} elem:{name:"instant"}} val:{uint_val:75}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"kernel"} elem:{name:"instant"}} val:{uint_val:15}} update:{path:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}} elem:{name:"state"} elem:{name:"user"} elem:{name:"instant"}} val:{uint_val:9}} delete:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"0"}}} delete:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"1"}}} delete:{elem:{name:"cpus"} elem:{name:"cpu" key:{key:"index" value:"2"}}}}}
2024/01/09 13:21:32.717705 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":0}}
2024/01/09 13:21:32.718326 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=1129647258922676094, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=0.000000,time=nil,addedAt=2024-01-09 13:21:32.718216163 +0800 CST m=+60.137365982
2024/01/09 13:21:32.718450 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:21:32.718626 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9438956315090224966, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:21:32.718551121 +0800 CST m=+60.137700942
2024/01/09 13:21:32.719097 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":15}}
2024/01/09 13:21:32.719559 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=16875950039623173897, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=15.000000,time=nil,addedAt=2024-01-09 13:21:32.719518971 +0800 CST m=+60.138668787
2024/01/09 13:21:32.719723 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"0","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:21:32.719863 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=17954654362136118179, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=0,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:21:32.719826905 +0800 CST m=+60.138976726
2024/01/09 13:21:32.720070 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":1}}
2024/01/09 13:21:32.720258 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=6542854036166583201, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=1.000000,time=nil,addedAt=2024-01-09 13:21:32.720227243 +0800 CST m=+60.139377059
2024/01/09 13:21:32.720718 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:21:32.720998 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=6940938159925040041, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:21:32.720900633 +0800 CST m=+60.140050453
2024/01/09 13:21:32.721351 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":15}}
2024/01/09 13:21:32.721711 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9082557441403925670, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=15.000000,time=nil,addedAt=2024-01-09 13:21:32.721476536 +0800 CST m=+60.140626374
2024/01/09 13:21:32.721974 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"1","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:21:32.722121 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=15662214335732753008, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=1,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:21:32.722089033 +0800 CST m=+60.141238849
2024/01/09 13:21:32.722211 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/index":2}}
2024/01/09 13:21:32.722496 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=9231366635998035096, metric: name=openconfig_system_system_cpus_cpu_index,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=2.000000,time=nil,addedAt=2024-01-09 13:21:32.722393789 +0800 CST m=+60.141543608
2024/01/09 13:21:32.722609 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/idle/instant":75}}
2024/01/09 13:21:32.723066 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=3178098174351140256, metric: name=openconfig_system_system_cpus_cpu_state_idle_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=75.000000,time=nil,addedAt=2024-01-09 13:21:32.722872972 +0800 CST m=+60.142022806
2024/01/09 13:21:32.723189 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/kernel/instant":15}}
2024/01/09 13:21:32.723554 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=13944315331769520307, metric: name=openconfig_system_system_cpus_cpu_state_kernel_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=15.000000,time=nil,addedAt=2024-01-09 13:21:32.723431462 +0800 CST m=+60.142581280
2024/01/09 13:21:32.723674 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"cpu_index":"2","source":"172.16.1.3:8080","subscription-name":"stream-sample"},"values":{"/openconfig-system:system/cpus/cpu/state/user/instant":9}}
2024/01/09 13:21:32.724257 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:437: [prometheus_output:prometheus] saved key=10448693330169184761, metric: name=openconfig_system_system_cpus_cpu_state_user_instant,labels=[cpu_index=2,source=172.16.1.3:8080,subscription_name=stream-sample],value=9.000000,time=nil,addedAt=2024-01-09 13:21:32.724073867 +0800 CST m=+60.143223685
2024/01/09 13:21:32.724393 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-sample","timestamp":1704777693101711229,"tags":{"source":"172.16.1.3:8080","subscription-name":"stream-sample"},"deletes":["cpus/cpu[index=0]","cpus/cpu[index=1]","cpus/cpu[index=2]"]}
^C
received signal 'interrupt'. terminating...
[test@arch-1 ~]$
tsmjay commented 10 months ago

Output from a non-working metric:

[test@arch-1 ~]$ gnmic -d --config /usr/local/etc/gnmic-3.yaml subscribe
2024/01/09 13:15:00.193504 /home/runner/work/gnmic/gnmic/pkg/app/app.go:223: [gnmic] version=0.34.3, commit=d461fa9, date=2023-11-14T02:13:11Z, gitURL=https://github.com/openconfig/gnmic, docs=https://gnmic.openconfig.net
2024/01/09 13:15:00.193685 /home/runner/work/gnmic/gnmic/pkg/app/app.go:228: [gnmic] using config file "/usr/local/etc/gnmic-3.yaml"
2024/01/09 13:15:00.196241 /home/runner/work/gnmic/gnmic/pkg/app/app.go:266: [gnmic] set flags/config:
address: []
api: ""
auth-scheme: ""
calculate-latency: false
capabilities-version: false
cluster-name: default-cluster
config: /usr/local/etc/gnmic-3.yaml
debug: true
diff-compare: []
diff-model: []
diff-path: []
diff-prefix: ""
diff-qos: "0"
diff-ref: ""
diff-set-to-notifs-full: false
diff-set-to-notifs-response: ""
diff-set-to-notifs-setrequest: ""
diff-setrequest-full: false
diff-setrequest-new: ""
diff-setrequest-ref: ""
diff-sub: false
diff-target: ""
diff-type: ALL
dir: []
encoding: json_ietf
exclude: []
file: []
format: ""
generate-camel-case: false
generate-config-only: false
generate-path: ""
generate-snake-case: false
get-model: []
get-path: []
get-prefix: ""
get-processor: []
get-target: ""
get-type: ALL
get-values-only: false
getset-condition: any([true])
getset-delete: ""
getset-get: ""
getset-model: []
getset-prefix: ""
getset-replace: ""
getset-target: ""
getset-type: ALL
getset-update: ""
getset-value: ""
gzip: false
insecure: false
instance-name: ""
listen-max-concurrent-streams: "256"
listen-prometheus-address: ""
log: true
log-file: ""
log-tls-secret: false
max-msg-size: 536870912
no-prefix: false
outputs:
  prometheus:
    debug: true
    listen: :9804
    path: /metrics
    type: prometheus
password: ""
path-config-only: false
path-descr: false
path-path-type: xpath
path-search: false
path-state-only: false
path-types: false
path-with-non-leaves: false
path-with-prefix: false
port: "57400"
print-request: false
prompt-description-bg-color: dark_gray
prompt-description-with-prefix: false
prompt-description-with-types: false
prompt-max-suggestions: "10"
prompt-prefix-color: dark_blue
prompt-suggest-all-flags: false
prompt-suggest-with-origin: false
prompt-suggestions-bg-color: dark_blue
proto-dir: []
proto-file: []
proxy-from-env: false
retry: 10s
set-delete: []
set-delimiter: ':::'
set-dry-run: false
set-prefix: ""
set-replace: []
set-replace-cli: []
set-replace-cli-file: ""
set-replace-file: []
set-replace-path: []
set-replace-value: []
set-request-file: []
set-request-replace: []
set-request-update: []
set-request-vars: ""
set-target: ""
set-union-replace: []
set-union-replace-file: []
set-union-replace-path: []
set-union-replace-value: []
set-update: []
set-update-cli: []
set-update-cli-file: ""
set-update-file: []
set-update-path: []
set-update-value: []
skip-verify: false
subscribe-backoff: 0s
subscribe-heartbeat-interval: 0s
subscribe-history-end: ""
subscribe-history-snapshot: ""
subscribe-history-start: ""
subscribe-lock-retry: 5s
subscribe-mode: stream
subscribe-model: []
subscribe-name: []
subscribe-output: []
subscribe-path: []
subscribe-prefix: ""
subscribe-qos: "0"
subscribe-quiet: false
subscribe-sample-interval: 0s
subscribe-set-target: false
subscribe-stream-mode: target-defined
subscribe-suppress-redundant: false
subscribe-target: ""
subscribe-updates-only: false
subscribe-watch-config: false
subscriptions:
  stream-on-change:
    mode: stream
    paths:
    - /openconfig-system:system/state/hostname
    sample-interval: 30s
    stream-mode: sample
targets:
  172.16.1.3:8080:
    password: test123
    skip-verify: true
    username: admin
targets-file: ""
timeout: 10s
tls-ca: ""
tls-cert: ""
tls-key: ""
tls-max-version: ""
tls-min-version: ""
tls-server-name: ""
tls-version: ""
token: ""
upgrade-use-pkg: false
use-tunnel-server: false
username: ""

2024/01/09 13:15:00.207814 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] config='/usr/local/etc/gnmic-3.yaml'(string)
2024/01/09 13:15:00.207977 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] debug='true'(bool)
2024/01/09 13:15:00.208163 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] encoding='json_ietf'(string)
2024/01/09 13:15:00.208926 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/debug='true'(bool)
2024/01/09 13:15:00.209632 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/listen=':9804'(string)
2024/01/09 13:15:00.210096 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/path='/metrics'(string)
2024/01/09 13:15:00.210515 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] outputs/prometheus/type='prometheus'(string)
2024/01/09 13:15:00.211014 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-on-change/mode='stream'(string)
2024/01/09 13:15:00.211436 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-on-change/paths='[/openconfig-system:system/state/hostname]'([]interface {})
2024/01/09 13:15:00.211861 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-on-change/sample-interval='30s'(string)
2024/01/09 13:15:00.212511 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] subscriptions/stream-on-change/stream-mode='sample'(string)
2024/01/09 13:15:00.213230 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] targets/172.16.1.3:8080/password='test123'(string)
2024/01/09 13:15:00.213858 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] targets/172.16.1.3:8080/skip-verify='true'(bool)
2024/01/09 13:15:00.214301 /home/runner/work/gnmic/gnmic/pkg/app/app.go:276: [gnmic] targets/172.16.1.3:8080/username='admin'(string)
2024/01/09 13:15:00.214437 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=backoff, changed=false, isSetInFile=false
2024/01/09 13:15:00.214567 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=heartbeat-interval, changed=false, isSetInFile=false
2024/01/09 13:15:00.214659 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=help, changed=false, isSetInFile=false
2024/01/09 13:15:00.214757 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=history-end, changed=false, isSetInFile=false
2024/01/09 13:15:00.214859 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=history-snapshot, changed=false, isSetInFile=false
2024/01/09 13:15:00.214957 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=history-start, changed=false, isSetInFile=false
2024/01/09 13:15:00.215066 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=lock-retry, changed=false, isSetInFile=false
2024/01/09 13:15:00.215177 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=mode, changed=false, isSetInFile=false
2024/01/09 13:15:00.215287 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=model, changed=false, isSetInFile=false
2024/01/09 13:15:00.215399 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=name, changed=false, isSetInFile=false
2024/01/09 13:15:00.215510 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=output, changed=false, isSetInFile=false
2024/01/09 13:15:00.215617 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=path, changed=false, isSetInFile=false
2024/01/09 13:15:00.215710 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=prefix, changed=false, isSetInFile=false
2024/01/09 13:15:00.215795 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=qos, changed=false, isSetInFile=false
2024/01/09 13:15:00.215880 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=quiet, changed=false, isSetInFile=false
2024/01/09 13:15:00.215965 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=sample-interval, changed=false, isSetInFile=false
2024/01/09 13:15:00.216050 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=set-target, changed=false, isSetInFile=false
2024/01/09 13:15:00.216138 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=stream-mode, changed=false, isSetInFile=false
2024/01/09 13:15:00.216237 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=suppress-redundant, changed=false, isSetInFile=false
2024/01/09 13:15:00.216327 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=target, changed=false, isSetInFile=false
2024/01/09 13:15:00.216410 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=updates-only, changed=false, isSetInFile=false
2024/01/09 13:15:00.216502 /home/runner/work/gnmic/gnmic/pkg/config/config.go:384: [config] cmd=subscribe, flagName=watch-config, changed=false, isSetInFile=false
2024/01/09 13:15:00.216634 /home/runner/work/gnmic/gnmic/pkg/config/subscriptions.go:48: [config] subscriptions map: map[string]interface {}{"stream-on-change":map[string]interface {}{"mode":"stream", "paths":[]interface {}{"/openconfig-system:system/state/hostname"}, "sample-interval":"30s", "stream-mode":"sample"}}
1 {"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}
2 {"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}
3 {"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}
2024/01/09 13:15:00.217696 /home/runner/work/gnmic/gnmic/pkg/config/subscriptions.go:67: [config] subscriptions: map[stream-on-change:{"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}]
2024/01/09 13:15:00.217852 /home/runner/work/gnmic/gnmic/pkg/config/outputs.go:61: [config] outputs: map[prometheus:map[debug:true format: listen::9804 path:/metrics type:prometheus]]
2024/01/09 13:15:00.217972 /home/runner/work/gnmic/gnmic/pkg/config/inputs.go:57: [config] inputs: map[]
2024/01/09 13:15:00.218086 /home/runner/work/gnmic/gnmic/pkg/config/actions.go:49: [config] actions: map[]
2024/01/09 13:15:00.218200 /home/runner/work/gnmic/gnmic/pkg/config/processors.go:45: [config] processors: map[]
2024/01/09 13:15:00.218413 /home/runner/work/gnmic/gnmic/pkg/config/targets.go:102: [config] read target config: {"name":"172.16.1.3:8080","address":"172.16.1.3:8080","username":"admin","password":"****","timeout":10000000000,"insecure":false,"tls-cert":"","tls-key":"","skip-verify":true,"buffer-size":100,"retry-timer":10000000000,"log-tls-secret":false,"gzip":false,"token":""}
2024/01/09 13:15:00.218929 /home/runner/work/gnmic/gnmic/pkg/config/targets.go:124: [config] targets: map[172.16.1.3:8080:{"name":"172.16.1.3:8080","address":"172.16.1.3:8080","username":"admin","password":"****","timeout":10000000000,"insecure":false,"tls-cert":"","tls-key":"","skip-verify":true,"buffer-size":100,"retry-timer":10000000000,"log-tls-secret":false,"gzip":false,"token":""}]
2024/01/09 13:15:00.219076 /home/runner/work/gnmic/gnmic/pkg/app/outputs.go:27: [gnmic] starting output type prometheus
2024/01/09 13:15:00.219297 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:75: [gnmic] queuing target "172.16.1.3:8080"
2024/01/09 13:15:00.219418 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:77: [gnmic] subscribing to target: "172.16.1.3:8080"
2024/01/09 13:15:00.219538 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:42: [gnmic] starting target &{Config:{"name":"172.16.1.3:8080","address":"172.16.1.3:8080","username":"admin","password":"****","timeout":10000000000,"insecure":false,"tls-cert":"","tls-key":"","skip-verify":true,"buffer-size":100,"retry-timer":10000000000,"log-tls-secret":false,"gzip":false,"token":""} Subscriptions:map[stream-on-change:{"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000}] m:0xc000ac4b90 conn:<nil> Client:<nil> SubscribeClients:map[] subscribeCancelFn:map[] pollChan:0xc00007f440 subscribeResponses:0xc00087f500 errors:0xc00087f560 stopped:false StopChan:0xc00007f620 Cfn:<nil> RootDesc:<nil>}
2024/01/09 13:15:00.219775 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:60: [gnmic] starting target "172.16.1.3:8080" listener
2024/01/09 13:15:00.220072 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel created
2024/01/09 13:15:00.220224 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] original dial target is: "172.16.1.3:8080"
2024/01/09 13:15:00.220366 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] dial target "172.16.1.3:8080" parse failed: parse "172.16.1.3:8080": first path segment in URL cannot contain colon
2024/01/09 13:15:00.220486 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] fallback to scheme "passthrough"
2024/01/09 13:15:00.220632 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] parsed dial target is: {URL:{Scheme:passthrough Opaque: User: Host: Path:/172.16.1.3:8080 RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2024/01/09 13:15:00.220766 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel authority set to "172.16.1.3:8080"
2024/01/09 13:15:00.220263 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:273: [prometheus_output:prometheus] initialized prometheus output: {"name":"prometheus","listen":":9804","path":"/metrics","expiration":60000000000,"debug":true,"timeout":10000000000,"num-workers":1}
2024/01/09 13:15:00.221101 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Resolver state updated: {
  "Addresses": [
    {
      "Addr": "172.16.1.3:8080",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Metadata": null
    }
  ],
  "Endpoints": [
    {
      "Addresses": [
        {
          "Addr": "172.16.1.3:8080",
          "ServerName": "",
          "Attributes": null,
          "BalancerAttributes": null,
          "Metadata": null
        }
      ],
      "Attributes": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)
2024/01/09 13:15:00.223618 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel switches to new LB policy "pick_first"
2024/01/09 13:15:00.223778 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [pick-first-lb 0xc000ae4330] Received new config {
  "shuffleAddressList": false
}, resolver state {
  "Addresses": [
    {
      "Addr": "172.16.1.3:8080",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Metadata": null
    }
  ],
  "Endpoints": [
    {
      "Addresses": [
        {
          "Addr": "172.16.1.3:8080",
          "ServerName": "",
          "Attributes": null,
          "BalancerAttributes": null,
          "Metadata": null
        }
      ],
      "Attributes": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
}
2024/01/09 13:15:00.226396 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel created
2024/01/09 13:15:00.226534 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel Connectivity change to CONNECTING
2024/01/09 13:15:00.226682 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING
2024/01/09 13:15:00.226711 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel picks a new address "172.16.1.3:8080" to connect
2024/01/09 13:15:00.226868 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [pick-first-lb 0xc000ae4330] Received SubConn state update: 0xc000ae44e0, {ConnectivityState:CONNECTING ConnectionError:<nil>}
2024/01/09 13:15:00.248733 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY
2024/01/09 13:15:00.248786 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [pick-first-lb 0xc000ae4330] Received SubConn state update: 0xc000ae44e0, {ConnectivityState:READY ConnectionError:<nil>}
2024/01/09 13:15:00.248795 /home/runner/go/pkg/mod/google.golang.org/grpc@v1.59.0/grpclog/logger.go:53: [gnmic] [core] [Channel #1] Channel Connectivity change to READY
2024/01/09 13:15:00.248806 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:220: [gnmic] target "172.16.1.3:8080" gNMI client created
2024/01/09 13:15:00.248824 /home/runner/work/gnmic/gnmic/pkg/app/gnmi_client_subscribe.go:223: [gnmic] sending gNMI SubscribeRequest: subscribe='subscribe:{subscription:{path:{elem:{name:"openconfig-system:system"} elem:{name:"state"} elem:{name:"hostname"}} mode:SAMPLE sample_interval:30000000000} encoding:JSON_IETF}', mode='STREAM', encoding='JSON_IETF', to 172.16.1.3:8080
2024/01/09 13:15:00.292069 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-on-change SubscriptionConfig:{"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:update:{timestamp:1704777300686173271 prefix:{elem:{name:"openconfig-system:system"} elem:{name:"state"}} update:{path:{elem:{name:"hostname"}} val:{string_val:"switch-3"}}}}
2024/01/09 13:15:00.292647 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-on-change","timestamp":1704777300686173271,"tags":{"source":"172.16.1.3:8080","subscription-name":"stream-on-change"},"values":{"/openconfig-system:system/state/hostname":"switch-3"}}
2024/01/09 13:15:00.292964 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-on-change SubscriptionConfig:{"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:sync_response:true}
2024/01/09 13:15:30.309868 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-on-change SubscriptionConfig:{"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:update:{timestamp:1704777330697602015 prefix:{elem:{name:"openconfig-system:system"} elem:{name:"state"}} update:{path:{elem:{name:"hostname"}} val:{string_val:"switch-3"}}}}
2024/01/09 13:15:30.311480 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-on-change","timestamp":1704777330697602015,"tags":{"source":"172.16.1.3:8080","subscription-name":"stream-on-change"},"values":{"/openconfig-system:system/state/hostname":"switch-3"}}
2024/01/09 13:16:00.310555 /home/runner/work/gnmic/gnmic/pkg/app/collector.go:71: [gnmic] target "172.16.1.3:8080": gNMI Subscribe Response: &{SubscriptionName:stream-on-change SubscriptionConfig:{"name":"stream-on-change","paths":["/openconfig-system:system/state/hostname"],"mode":"stream","stream-mode":"sample","sample-interval":30000000000} Response:update:{timestamp:1704777360697941933 prefix:{elem:{name:"openconfig-system:system"} elem:{name:"state"}} update:{path:{elem:{name:"hostname"}} val:{string_val:"switch-3"}}}}
2024/01/09 13:16:00.312690 /home/runner/work/gnmic/gnmic/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go:423: [prometheus_output:prometheus] got event to store: {"name":"stream-on-change","timestamp":1704777360697941933,"tags":{"source":"172.16.1.3:8080","subscription-name":"stream-on-change"},"values":{"/openconfig-system:system/state/hostname":"switch-3"}}
^C
received signal 'interrupt'. terminating...
[test@arch-1 ~]$

I've also tried with stream-mode: on-change, with no sample-interval.

Am I missing something?

Thanks.

karimra commented 10 months ago

Hi,

You are subscribing to the device hostname

subscriptions:
  stream-on-change:
    mode: stream
    paths:
    - /openconfig-system:system/state/hostname
    sample-interval: 30s
    stream-mode: sample

That path returns a string value. Prometheus metrics are numeric values (counter, gauge, histogram, and summary) Try subscribing to something like interface stats, you will get some data.