{"id":25996768,"url":"https://github.com/trinchan/sysdig-go","last_synced_at":"2025-07-29T06:09:17.505Z","repository":{"id":40308629,"uuid":"412857296","full_name":"trinchan/sysdig-go","owner":"trinchan","description":"Go library for accessing the Sysdig API ","archived":false,"fork":false,"pushed_at":"2023-04-24T01:12:11.000Z","size":133,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-23T08:49:52.661Z","etag":null,"topics":["client","go","golang","ibm-cloud","ibm-cloud-monitoring","monitoring","prometheus","sysdig","sysdig-monitor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinchan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-02T16:54:19.000Z","updated_at":"2022-02-25T09:26:39.000Z","dependencies_parsed_at":"2024-06-21T02:05:38.848Z","dependency_job_id":"f201eac1-eabc-4ac4-b214-7166011047f2","html_url":"https://github.com/trinchan/sysdig-go","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/trinchan/sysdig-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinchan%2Fsysdig-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinchan%2Fsysdig-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinchan%2Fsysdig-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinchan%2Fsysdig-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinchan","download_url":"https://codeload.github.com/trinchan/sysdig-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinchan%2Fsysdig-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267639025,"owners_count":24119768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","go","golang","ibm-cloud","ibm-cloud-monitoring","monitoring","prometheus","sysdig","sysdig-monitor"],"created_at":"2025-03-05T16:40:22.372Z","updated_at":"2025-07-29T06:09:17.477Z","avatar_url":"https://github.com/trinchan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sysdig-go #\n\n[![sysdig-go release](https://img.shields.io/github/v/release/trinchan/sysdig-go?sort=semver)](https://github.com/trinchan/sysdig-go/releases)\n[![Go Reference](https://pkg.go.dev/badge/github.com/trinchan/sysdig-go/sysdig.svg)](https://pkg.go.dev/github.com/trinchan/sysdig-go/sysdig)\n[![Test Status](https://github.com/trinchan/sysdig-go/workflows/tests/badge.svg)](https://github.com/trinchan/sysdig-go/actions?query=workflow%3Atests)\n[![Test Coverage](https://codecov.io/gh/trinchan/sysdig-go/branch/master/graph/badge.svg)](https://codecov.io/gh/trinchan/sysdig-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/trinchan/sysdig-go)](https://goreportcard.com/report/github.com/trinchan/sysdig-go)\n\n`sysdig-go` is a Go client library for accessing the [Sysdig](https://docs.sysdig.com/en/docs/developer-tools) and [IBM Cloud Monitoring](https://cloud.ibm.com/apidocs/monitor) APIs.\n\n## Installation ##\n\n`sysdig-go` supports **go \u003e=1.16**.\n\n```bash\ngo get github.com/trinchan/sysdig-go\n```\n\nwill resolve and add the package to the current development module, along with its dependencies.\n\nAlternatively the same can be achieved if you use import in a package:\n\n```go\nimport \"github.com/trinchan/sysdig-go/sysdig\"\n```\n\nand run `go get` without parameters.\n\n## Implemented APIs ##\n|       Base              | Get | List | Create | Delete | Update | Other                   | Service                       | Description |\n|:-----------------------:|:---:|:----:|:------:|:------:|:------:|:-----------------------:|:-----------------------------:|-------------|\n| `/team`                 |✓    |✓     |x       |✓       |x       |ListUsers, Infrastructure| `client.Teams`                |[Information about teams, users, and usage](https://docs.sysdig.com/en/docs/administration/administration-settings/user-and-team-administration/manage-teams-and-roles/) |\n| `/user/me`              |✓    |x     |x       |x       |x       |x                        | `client.Users`                |[Information about the current user](https://docs.sysdig.com/en/docs/administration/administration-settings/find-your-customer-id-and-name/) |\n| `/token`                |✓    |x     |x       |x       |x       |x                        | `client.Users`                |[Retrieves the current user's access token](https://docs.sysdig.com/en/docs/administration/administration-settings/find-your-customer-id-and-name/) |\n| `/agents/connected`     |✓    |x     |x       |x       |x       |x                        | `client.Users`                |[Rerieves the connected Agents](https://docs.sysdig.com/en/docs/sysdig-monitor/)\n| `/alerts`               |✓    |✓     |✓       |x       |x       |x                        | `client.Alerts`               |[Manage alert configurations](https://docs.sysdig.com/en/docs/sysdig-monitor/alerts/manage-alerts/) |\n| `/v3/dashboards`        |✓    |✓     |✓       |✓       |✓       |Favorite, Transfer       | `client.Dashboards`           |[Manage dashboard configurations](https://docs.sysdig.com/en/docs/sysdig-monitor/dashboards/) |\n| `/v2/events`            |✓    |✓     |✓       |✓       |x       |x                        | `client.Events`               |[Manage event notifications](https://docs.sysdig.com/en/docs/sysdig-monitor/events/) |\n| `/notificationChannels` |✓    |✓     |✓       |✓       |x       |x                        | `client.NotificationChannels` |[Manage notification channels](https://docs.sysdig.com/en/docs/administration/administration-settings/notifications-management/set-up-notification-channels/) |\n| `/prometheus`           |✓    |✓     |x       |x       |x       |x                        | `client.Prometheus`           |[Prometheus HTTP API](https://prometheus.io/docs/prometheus/latest/querying/api/) |\n\n## Usage ##\n\n```go\nimport \"github.com/trinchan/sysdig-go/sysdig\"\n```\n\nConstruct a new Sysdig client, then use the various services on the client to\naccess different parts of the API. For example:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trinchan/sysdig-go/sysdig\"\n\t\"github.com/trinchan/sysdig-go/sysdig/authentication/accesstoken\"\n)\n\nfunc main() {\n\taccessToken := \"YOUR_ACCESS_TOKEN\"\n\tauthenticator, err := accesstoken.Authenticator(accessToken)\n\tif err != nil {\n\t\t// handle error\n\t}\n\tclient, err := sysdig.NewClient(authenticator)\n\tif err != nil {\n\t\t// handle error\n\t}\n\n\t// Get the current user\n\tme, _, err := client.Users.Me(context.Background())\n\tif err != nil {\n\t\t// handle error\n\t}\n\tfmt.Printf(\"Logged in as %s %s\", me.User.FirstName, me.User.LastName)\n}\n```\n\nSome API methods have optional parameters that can be passed. For example:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trinchan/sysdig-go/sysdig\"\n\t\"github.com/trinchan/sysdig-go/sysdig/authentication/accesstoken\"\n)\n\nfunc main() {\n\taccessToken := \"YOUR_ACCESS_TOKEN\"\n\tauthenticator, err := accesstoken.Authenticator(accessToken)\n\tif err != nil {\n\t\t// handle error\n\t}\n\tclient, err := sysdig.NewClient(authenticator)\n\tif err != nil {\n\t\t// handle error\n\t}\n\n\t// Create an event\n\topts := sysdig.EventOptions{\n\t\tName:        \"Event Name\",\n\t\tDescription: \"Event Description\",\n\t\tSeverity:     sysdig.SeverityInfo,\n\t}\n\tevent, _, err := client.Events.Create(context.Background(), opts)\n\tif err != nil {\n\t\t// handle error\n\t}\n\tfmt.Printf(\"Created event: %s\", event.Event.ID)\n}\n```\n\nThe services of a client divide the API into logical chunks and correspond roughly to\nthe structure of the Sysdig API.\n\nNOTE: Using the [context](https://pkg.go.dev/context) package, one can easily\npass cancellation signals and deadlines to various services of the client for\nhandling a request. In case there is no context available, then `context.Background()`\ncan be used as a starting point.\n\nFor more sample code snippets, head over to the\n[example](https://github.com/trinchan/sysdig-go/tree/master/example) directory.\n\n### Authentication ###\n\nThe sysdig-go library handles authentication through an `Authenticator` interface defined in the\n[authentication](https://github.com/trinchan/sysdig-go/tree/master/sysdig/authentication) package.\nWhen creating a new client, pass an `authentication.Authenticator` that can handle authentication for\nyou. There are two methods of authentication supported.\n\nThe `accesstoken` subpackage authenticates each request with the provided [Sysdig API Token](https://docs.sysdig.com/en/docs/administration/administration-settings/user-profile-and-password/retrieve-the-sysdig-api-token).\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trinchan/sysdig-go/sysdig\"\n\t\"github.com/trinchan/sysdig-go/sysdig/authentication/accesstoken\"\n)\n\n\nfunc main() {\n\taccessToken := \"YOUR_ACCESS_TOKEN\"\n\tauthenticator, err := accesstoken.Authenticator(accessToken)\n\tif err != nil {\n\t\t// handle error\n\t}\n\tclient, err := sysdig.NewClient(authenticator)\n}\n```\nThe `ibmiam` subpackage authenticates each request with an [IBM Cloud IAM Token](https://cloud.ibm.com/docs/monitoring?topic=monitoring-api_token). It automatically retrieves and refreshes an IAM Token using an IBM Cloud API Key.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/trinchan/sysdig-go/sysdig\"\n\t\"github.com/trinchan/sysdig-go/sysdig/authentication/ibmiam\"\n)\n\n\nfunc main() {\n\tapiKey := \"YOUR_IBM_CLOUD_API_KEY\"\n\tinstanceID := \"YOUR_IBM_CLOUD_MONITORING_INSTANCE_ID\"\n\tauthenticator, err := ibmiam.Authenticator(apiKey, ibmiam.WithIBMInstanceID(instanceID))\n\tif err != nil {\n\t\t// Handle error\n\t}\n\tclient, err := sysdig.NewClient(authenticator, sysdig.WithIBMBaseURL(sysdig.RegionUSSouth, false))\n}\n```\n\nSee the [example](https://github.com/trinchan/sysdig-go/tree/master/example) directory for more authentication examples.\n\n## Prometheus API ##\n\nSysdig offers a limited [Prometheus HTTP API](https://prometheus.io/docs/prometheus/latest/querying/api).\n\nThis API is exposed via the `Prometheus` Service of the Client. You can use this client to run PromQL queries against your Sysdig instance.\n\n_Most_ functionality of the HTTP API is not available from Sysdig, but they appear to be offering more and more.\nSee the [Prometheus example](https://github.com/trinchan/sysdig-go/tree/master/example/prometheus).\n\n## Client Options ##\n\n### Debug Mode\n\nDebug mode can be enabled by setting the following client options:\n\n```go\nsysdig.NewClient(sysdig.WithDebug(true), sysdig.WithLogger(log.Default())) // Or other Logger\n```\n\nSetting `Debug` mode will print out the request URLs and response body and headers, along with other debug information.\n\nThis is useful for debugging parse issues and during development.\n\n### Compression ###\n\nThe Sysdig API (and this client) supports [gzip](https://docs.sysdig.com/en/docs/developer-tools/sysdig-rest-api-conventions/#encoding) to reduce the size of responses. This can be useful for large queries.\n\n```go\nsysdig.NewClient(sysdig.WithResponseCompression(true))\n```\n\nFor other options, check the [documentation](https://pkg.go.dev/github.com/trinchan/sysdig-go/sysdig#ClientOption).\n\n## FAQ ##\n\n### \"Can you add X API?\"\n\nYes! Open an issue with the API path and as much information about it as you can for a better chance of it getting developed. Or better yet, submit a patch!. In the mean time,\nyou can also use the `client.Do()` method to send a custom request.\n\n### \"The response for this API is wrong/broken!\" ###\n\nThat's not a question! The client is incomplete as documentation for most of the Sysdig API has not been published. I have had to leave some types as `interface{}` until documentation is released or I receive a sample response. Submit an issue and include the (redacted) client logs with `Debug` mode enabled.\n\n### \"The documentation is wrong!\" ###\n\nSince there is no official documentation for most of the API, some documentation is bound to be incorrect. Corrections and improvements\nare very welcome -- please file an issue or submit a patch if you find something is inaccurate.\n\n### \"Is this an official client?\" ###\n\nNope. The only official client I know is the [Python SDK](https://github.com/sysdiglabs/sysdig-sdk-python).\n\n## Versioning ##\n\n`sysdig-go` is currently undergoing its initial development and is still incomplete. As new APIs are documented by Sysdig and IBM Cloud, new\nAPIs will be added or changed. Since `sysdig-go` is a client library, breaking changes in the upstream API may require updates to the client.\n`sysdig-go` will follow semver as closely as possible to minimize breaking changes.\n\n## Credits ##\n- Sysdig's [Python SDK](https://github.com/sysdiglabs/sysdig-sdk-python) for API reference.\n- Google's [Github Client](https://github.com/google/go-github) for client and repo design reference.\n\n## License ##\n\nThis library is distributed under the MIT license found in the [LICENSE](./LICENSE)\nfile.\n\n---\n_\"Sysdig\" and \"IBM Cloud\" are registered trademarks of their respective holders. Use of the name does not imply any affiliation with or endorsement by them._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinchan%2Fsysdig-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinchan%2Fsysdig-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinchan%2Fsysdig-go/lists"}