Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 39,511
    • Issues 39,511
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 1,223
    • Merge requests 1,223
  • Requirements
    • Requirements
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #211330

Closed
Open
Created Mar 16, 2020 by Dhiraj Bodicherla@dbodicherla👋Contributor

Backend: Expose an endpoint to fetch all annotations

Problem to solve

The annotations model implemented in #211329 (closed) should be accessible via API so that the frontend can hit to perform basic read operations.

More information about the technical break down here #205091 (comment 302202307)

Technical details

PoC available here: !27675 (closed)

This API will be a GraphQL API.

Based on the model here https://gitlab.com/gitlab-org/gitlab/-/issues/211329#annotation-model, annotations are associated with panel Id, cluster Id, dashboard Id.

Query

query {
  project(fullPath: "monitoring-group/docker-app-clone") {
    id
    environment(name: "production") {
      id
      name
      metricsDashboard (id: "custom_dashboard.yml") {
        id
        annotations {
          nodes {
            id
            description
            from
            to
            panelId
          }
     	}
      }
    }
  }
}

Response:

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/28",
      "environment": {
        "id": "gid://gitlab/Environment/34",
        "name": "production",
        "metricsDashboard": {
          "id": "gid://custom_dashboard.yml",
          "annotations": {
            "nodes": [
              {
                "id": "gid://gitlab/Annotations/1",
                "description": "annotation description",
                "from": "2020-03-20 13:50:07",
                "to": null,
                "panelId": null
              },
              {
                "id": "gid://gitlab/Annotations/2",
                "description": "annotation description",
                "from": "2020-03-20 13:50:07",
                "to": null,
                "panelId": "some-panel-id"
              }
            ]
          }
        }
      }
    }
  }
}
Edited Nov 16, 2020 by 🤖 GitLab Bot 🤖
Assignee
Assign to
Time tracking