Skip to content
Snippets Groups Projects

tracing: Replace Provisioning mocks with actual API calls

Merged Daniele Rossetti requested to merge rossetd/provisioning-api into master
1 unresolved thread

What does this MR do and why?

Hooking up client with Provisioning API (spec)

Closes gitlab-org/opstrace/opstrace#2271 (closed)

(Note this feature is FeatureFlagged, Experimental and WIP - no active users yet apart from some internal testers )

Screenshots or screen recordings

N/A

How to set up and validate locally

  • RSpec

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Daniele Rossetti

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • b7b87c04 - tracing: Remove Provisioning API mocks

    Compare with previous version

  • Daniele Rossetti changed title from Draft: tracing: Remove Provisioning API mocks to Draft: tracing: Replace Provisioning mocks with actual API calls

    changed title from Draft: tracing: Remove Provisioning API mocks to Draft: tracing: Replace Provisioning mocks with actual API calls

  • Daniele Rossetti marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed

    marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed

  • Daniele Rossetti requested review from @mcavoj

    requested review from @mcavoj

  • Daniele Rossetti requested review from @sdejonge

    requested review from @sdejonge

  • Daniele Rossetti removed review request for @sdejonge

    removed review request for @sdejonge

  • Daniele Rossetti requested review from @robyrne

    requested review from @robyrne

  • Daniele Rossetti marked this merge request as ready

    marked this merge request as ready

  • Daniele Rossetti changed the description

    changed the description

  • Martin Čavoj requested review from @alexpooley and removed review request for @mcavoj

    requested review from @alexpooley and removed review request for @mcavoj

  • Martin Čavoj approved this merge request

    approved this merge request

  • 👋 @mcavoj, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.

    For more info, please refer to the following links:

  • Ross Byrne approved this merge request

    approved this merge request

  • Ross Byrne requested review from @mrincon and removed review request for @robyrne

    requested review from @mrincon and removed review request for @robyrne

  • 31 31 "#{Gitlab::Observability.observability_url}/query/#{project.group.id}/#{project.id}/v1/traces"
    32 32 end
    33 33
    34 def provisioning_url(_project)
    35 # TODO Change to correct endpoint when API is ready
    36 Gitlab::Observability.observability_url.to_s
    34 def provisioning_url(project)
    35 "#{Gitlab::Observability.observability_url}/v3/tenant/#{project.id}"
    • Question: I am not too familiar with this area, why is this v3? It this a standard we can assume folks to know about?

      If not it would be nice to have in a constant that describes where it comes from. 👍

    • This is api prefix currently used by observability backend - we are at version v3 ATM, v1 and v2 being previous iterations.

    • 👍 If it is our own, is there a way to use Rails routes to generate it?

    • Author Developer

      Note this API is not in Rails but a separate backend

    • good point - I think we can leveraging direct routes

      See some of our starts with this in config/routes/directs.rb

    • Author Developer

      What's the advantage of using direct routes in this case? Is it just to make the *_url available everywhere? Do we need/want to? I think having it encapsulated in the Observability module makes more sense. WDYT?

      Edited by Daniele Rossetti
    • I don't have a strong opinion on using routes, but it would be nice to have a single source of truth for this. We have other urls with v1 so it's hard to see from looking at the code where the difference comes from.

    • Author Developer

      it would be nice to have a single source of truth for this

      This module GitLab::Observability is meant to be the single source of truth for Observability API. Or did you mean something differently?

      Edited by Daniele Rossetti
    • Perhaps this is as simple as a constant in this module? I see v1 as well so we are supporting both.

    • Author Developer

      Ah I see what you mean. I'm not sure how the backend versioning works tbh. Let me ask the backend team here.

      @gl-observability Hey folks can you shed some lights here about backend versioning? Do different API have different versions? Or all share the same version?

      For instance, we have the following URL defined here:

          def oauth_url
            "#{Gitlab::Observability.observability_url}/v1/auth/start"
          end
      
          def tracing_url(project)
            "#{Gitlab::Observability.observability_url}/query/#{project.group.id}/#{project.id}/v1/traces"
          end
      
          def provisioning_url(project)
            "#{Gitlab::Observability.observability_url}/v3/tenant/#{project.id}"
          end

      Both v1 and v3 are used. Should they all be the same? Or are they not shared?

      Edited by Daniele Rossetti
    • @drosse They should ideally be all the same (v3), but they're also not shared right now.

      • v3 primarily comes from our decision to build new APIs/endpoints as per the latest architectural changes deprecating GOUI-specific things which we drafted as v2.

      • The tracing_url was discussed to be changed to v3 here: gitlab-org/opstrace/opstrace!2146 (comment 1468395164) and being tracked with gitlab-org/opstrace/opstrace#2282.

      • The oauth_url with v1 can stay as is for now, independent of our backend/subsystem specific endpoints.

    • Author Developer

      Thanks for the clarification @ankitbhatnagar !

      @mrincon Based on the above, I'm not sure it makes sense to extract the version, as for the moment at least, each API is using is own version and there is maybe not much point in having 3 constants used by 3 APIs. WDYT?

    • Ok, as a reviewer it's difficult to know where all those versions came from but it looks like you can document this elsewhere, I won't block this MR over this. 👍

      Edited by Miguel Rincon
    • Thanks for the discussion here. I still think we should try to go in a direction of using direct routes for in house url definitions, but I won't block this and will spawn a follow-up issue instead.

    • Doug Stull created #422522 to continue this discussion

      created #422522 to continue this discussion

    • @drosse @ankitbhatnagar Wondering if those API versions need to be documented somewhere that is more transparent? To prevent confusion etc?

      Having them outside of the Rails codebase makes them even more opaque.

    • Please register or sign in to reply
  • added 1 commit

    • 7cca9880 - Reporting client API errors to Sentry

    Compare with previous version

  • Daniele Rossetti added 767 commits

    added 767 commits

    Compare with previous version

  • Daniele Rossetti requested review from @dstull and removed review request for @alexpooley

    requested review from @dstull and removed review request for @alexpooley

  • added 1 commit

    Compare with previous version

  • Miguel Rincon approved this merge request

    approved this merge request

  • Doug Stull mentioned in issue #422522

    mentioned in issue #422522

  • Doug Stull resolved all threads

    resolved all threads

  • Doug Stull approved this merge request

    approved this merge request

  • Doug Stull enabled an automatic merge when the pipeline for 3f92a6c3 succeeds

    enabled an automatic merge when the pipeline for 3f92a6c3 succeeds

  • merged

  • Doug Stull mentioned in commit 24a8aff9

    mentioned in commit 24a8aff9

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading