-
Notifications
You must be signed in to change notification settings - Fork 892
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(analysis): add Apache SkyWalking as metrics provider
Signed-off-by: kezhenxu94 <[email protected]> Signed-off-by: zachaller <[email protected]> Co-authored-by: zachaller <[email protected]>
- Loading branch information
1 parent
4afac4e
commit 75723b2
Showing
21 changed files
with
1,403 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Apache SkyWalking Metrics | ||
|
||
!!! important | ||
Available since v1.5.0 | ||
|
||
A [SkyWalking](https://skywalking.apache.org/) query using GraphQL can be used to obtain measurements for analysis. | ||
|
||
```yaml | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: AnalysisTemplate | ||
metadata: | ||
name: apdex | ||
spec: | ||
args: | ||
- name: service-name | ||
metrics: | ||
- name: apdex | ||
interval: 5m | ||
successCondition: "all(result.service_apdex.values.values, {asFloat(.value) >= 9900})" | ||
failureLimit: 3 | ||
provider: | ||
skywalking: | ||
interval: 3m | ||
address: http://skywalking-oap.istio-system:12800 | ||
query: | | ||
query queryData($duration: Duration!) { | ||
service_apdex: readMetricsValues( | ||
condition: { name: "service_apdex", entity: { scope: Service, serviceName: "{{ args.service-name }}", normal: true } }, | ||
duration: $duration) { | ||
label values { values { value } } | ||
} | ||
} | ||
``` | ||
The `result` evaluated for the query depends on the specific GraphQL you give, you can try to run the GraphQL query first and inspect the output format, then compose the condition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package skywalking | ||
|
||
type mockAPI struct { | ||
err error | ||
results interface{} | ||
} | ||
|
||
func (m mockAPI) Query(query string) (interface{}, error) { | ||
if m.err != nil { | ||
return m.results, m.err | ||
} | ||
return m.results, nil | ||
} |
Oops, something went wrong.