File tree 2 files changed +19
-24
lines changed
examples/example-exporter-opentelemetry/oats-tests/agent
2 files changed +19
-24
lines changed Original file line number Diff line number Diff line change 1
1
name : Deploy Documentation to Github Pages
2
2
3
3
on :
4
- push :
5
- branches : ["main"]
6
- pull_request :
7
- branches : ["main"]
8
-
9
4
# 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
17
10
18
11
# Allows you to run this workflow manually from the Actions tab
19
12
workflow_dispatch :
Original file line number Diff line number Diff line change 3
3
"""This script is used to check if the service instance id is present in the exported data
4
4
The script will return 0 if the service instance id is present in the exported data"""
5
5
6
+ import json
6
7
import urllib .parse
7
8
from urllib .request import urlopen
8
9
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" )
15
22
16
23
# uncomment the following line to use the local file instead of the url - for debugging
17
24
# with open('example_target_info.json') as f:
31
38
32
39
path = f'target_info{{instance="{ values [0 ]} "}}'
33
40
path = 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 } " )
40
42
41
43
infos = res ["data" ]["result" ]
42
44
print (infos )
You can’t perform that action at this time.
0 commit comments