File tree Expand file tree Collapse file tree 2 files changed +19
-24
lines changed
examples/example-exporter-opentelemetry/oats-tests/agent Expand file tree Collapse file tree 2 files changed +19
-24
lines changed Original file line number Diff line number Diff line change 11name : Deploy Documentation to Github Pages
22
33on :
4- push :
5- branches : ["main"]
6- pull_request :
7- branches : ["main"]
8-
94 # Runs on pushes targeting the 1.0.x branch
10- # todo revert this
11- # on:
12- # push:
13- # branches:
14- # - main
15- # tags:
16- # - "v*.*.*" # updates the version in the docs
5+ push :
6+ branches :
7+ - main
8+ tags :
9+ - " v*.*.*" # updates the version in the docs
1710
1811 # Allows you to run this workflow manually from the Actions tab
1912 workflow_dispatch :
Original file line number Diff line number Diff line change 33"""This script is used to check if the service instance id is present in the exported data
44The script will return 0 if the service instance id is present in the exported data"""
55
6+ import json
67import urllib .parse
78from urllib .request import urlopen
89
9- URL = " http://localhost:9090/api/v1/query?query=target_info"
10- with urlopen (URL ) as response :
11- # read the response
12- res = response .read ()
13- # decode the response
14- res = res .decode ("utf-8" )
10+
11+ def get (url ):
12+ global response , res
13+ with urlopen (url ) as response :
14+ # read the response
15+ res = response .read ()
16+ # decode the response
17+ res = json .loads (res .decode ("utf-8" ))
18+ return res
19+
20+
21+ res = get (" http://localhost:9090/api/v1/query?query=target_info" )
1522
1623# uncomment the following line to use the local file instead of the url - for debugging
1724# with open('example_target_info.json') as f:
3138
3239path = f'target_info{{instance="{ values [0 ]} "}}'
3340path = urllib .parse .quote_plus (path )
34- URL = f"http://localhost:9090/api/v1/query?query={ path } "
35- with urlopen (URL ) as response :
36- # read the response
37- res = response .read ()
38- # decode the response
39- res = res .decode ("utf-8" )
41+ res = get (f"http://localhost:9090/api/v1/query?query={ path } " )
4042
4143infos = res ["data" ]["result" ]
4244print (infos )
You can’t perform that action at this time.
0 commit comments