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

[ide-metrics] add error reporting api #12705

Merged
merged 3 commits into from
Sep 7, 2022
Merged

[ide-metrics] add error reporting api #12705

merged 3 commits into from
Sep 7, 2022

Conversation

iQQBot
Copy link
Contributor

@iQQBot iQQBot commented Sep 6, 2022

Description

This PR enrich ide-metrics to allow collection of IDE client error logs and reporting them to GCP error logging.

On gitpod.io we reporting them to GCP, on preview environment we write it in stdin, on self-hosted we ignore it.

Related Issue(s)

Fixes #11915

How to test

  1. run below curl command
## cURL
curl -X "POST" "https://ide.pd-logging-api.preview.gitpod-dev.com/metrics-api/reportError" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "component": "supervisor-frontend",
  "workspaceId": "workspaceId1",
  "error_stack": "Error: test-error\\n    at REPL16:1:7\\n    at Script.runInThisContext (node:vm:129:12)\\n    at REPLServer.defaultEval (node:repl:566:29)\\n    at bound (node:domain:421:15)\\n    at REPLServer.runBound [as eval] (node:domain:432:12)\\n    at REPLServer.onLine (node:repl:893:10)\\n    at REPLServer.emit (node:events:539:35)\\n    at REPLServer.emit (node:domain:475:12)\\n    at REPLServer.[_onLine] [as _onLine] (node:internal/readline/interface:418:12)\\n    at REPLServer.[_line] [as _line] (node:internal/readline/interface:879:18)",
  "instanceId": "instanceId1",
  "userId": "userId",
  "properties": {
    "p2": "v2",
    "p1": "v1"
  }
}'
  1. see pod ide-metrics logs, it should be log.
  2. try to modify component to another value and execute again, it should be reject because component has an allowlist.

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@iQQBot iQQBot changed the title Pd/logging-api [ide-metrics] add error reporting api Sep 6, 2022
@iQQBot iQQBot force-pushed the pd/logging-api branch 3 times, most recently from 75b5c74 to a7dc039 Compare September 6, 2022 17:18
@iQQBot iQQBot marked this pull request as ready for review September 6, 2022 17:46
@iQQBot iQQBot requested review from a team September 6, 2022 17:46
@github-actions github-actions bot added team: IDE team: delivery Issue belongs to the self-hosted team labels Sep 6, 2022
@jeanp413
Copy link
Member

jeanp413 commented Sep 7, 2022

I think these endpoints needs authentication so they're not abused so easily

@mustard-mh
Copy link
Contributor

mustard-mh commented Sep 7, 2022

Tested well as promised

CURL GCP Report Report Detail
image image image

@akosyakov
Copy link
Member

I think these endpoints needs authentication so they're not abused so easily

It is the same as with analytics or observability. We are going to add rate limitting per ip to prevent abuse. Or maybe we already have. The thing is that we did not have problems so far. So I think it should be done separately.

Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

lgtm, let's bring it 🚀

@roboquat roboquat merged commit 3fe748c into main Sep 7, 2022
@roboquat roboquat deleted the pd/logging-api branch September 7, 2022 08:54
@roboquat roboquat added the deployed: IDE IDE change is running in production label Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production release-note-none size/XXL team: delivery Issue belongs to the self-hosted team team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IDE clients logs
6 participants