Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stat: support -ojson option with srv resources #6959

Merged
merged 1 commit into from
Sep 23, 2021
Merged

Conversation

Pothulapati
Copy link
Contributor

@Pothulapati Pothulapati commented Sep 23, 2021

Policy resources are already supported just like
any other resources. For srv, the newly unauthorized
field is missed in the json response.

This PR tries to fix that.

Output

on ⛵ kind-kind  linkerd2 on 🌱 taru [📦📝🤷‍] via 🐼 v1.16.8 via  via ⚙️ v1.55.0
➜ ./bin/go-run cli viz stat srv -n emojivoto -ojson                                                                      ~/work/linkerd2
[
  {
    "namespace": "emojivoto",
    "kind": "server",
    "name": "emoji-grpc",
    "success": 1,
    "rps": 2,
    "latency_ms_p50": 1,
    "latency_ms_p95": 1,
    "latency_ms_p99": 1,
    "tcp_open_connections": 0,
    "tcp_read_bytes_rate": 0,
    "tcp_write_bytes_rate": 0,
    "unauthorized": 0
  },
  {
    "namespace": "emojivoto",
    "kind": "server",
    "name": "prom",
    "success": null,
    "rps": null,
    "latency_ms_p50": null,
    "latency_ms_p95": null,
    "latency_ms_p99": null
  },
  {
    "namespace": "emojivoto",
    "kind": "server",
    "name": "voting-grpc",
    "success": 0.8833333333333333,
    "rps": 1,
    "latency_ms_p50": 1,
    "latency_ms_p95": 1,
    "latency_ms_p99": 1,
    "tcp_open_connections": 0,
    "tcp_read_bytes_rate": 0,
    "tcp_write_bytes_rate": 0,
    "unauthorized": 0
  },
  {
    "namespace": "emojivoto",
    "kind": "server",
    "name": "web-http",
    "success": 0.9576271186440678,
    "rps": 1.9666666666666666,
    "latency_ms_p50": 1,
    "latency_ms_p95": 5,
    "latency_ms_p99": 9,
    "tcp_open_connections": 0,
    "tcp_read_bytes_rate": 0,
    "tcp_write_bytes_rate": 0,
    "unauthorized": 0
  }
]

on ⛵ kind-kind  linkerd2 on 🌱 taru [📦📝🤷‍] via 🐼 v1.16.8 via  via ⚙️ v1.55.0took 2s
➜ ./bin/go-run cli viz stat saz -n emojivoto -ojson                                                                      ~/work/linkerd2
[
  {
    "namespace": "emojivoto",
    "kind": "serverauthorization",
    "name": "emoji-grpc",
    "success": 0.9666666666666667,
    "rps": 4,
    "latency_ms_p50": 1,
    "latency_ms_p95": 3,
    "latency_ms_p99": 5
  },
  {
    "namespace": "emojivoto",
    "kind": "serverauthorization",
    "name": "prom-prometheus",
    "success": null,
    "rps": null,
    "latency_ms_p50": null,
    "latency_ms_p95": null,
    "latency_ms_p99": null
  },
  {
    "namespace": "emojivoto",
    "kind": "serverauthorization",
    "name": "voting-grpc",
    "success": 0.8666666666666667,
    "rps": 1,
    "latency_ms_p50": 1,
    "latency_ms_p95": 1,
    "latency_ms_p99": 1
  },
  {
    "namespace": "emojivoto",
    "kind": "serverauthorization",
    "name": "web-public",
    "success": null,
    "rps": null,
    "latency_ms_p50": null,
    "latency_ms_p95": null,
    "latency_ms_p99": null
  }
]

Signed-off-by: Tarun Pothulapati [email protected]

Policy resources are already supported just like
any other resources. For `srv`, the newly `unauthorized`
field is missed in the json response.

This PR tries to fix that.

Signed-off-by: Tarun Pothulapati <[email protected]>
@Pothulapati Pothulapati requested a review from a team as a code owner September 23, 2021 11:00
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@alpeb alpeb merged commit 61cd107 into main Sep 23, 2021
@alpeb alpeb deleted the tarun/authz-stat-json branch September 23, 2021 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants