Skip to content

[BUG] Workspace diagnostics return the wrong logger ID #803

@guythetechie

Description

@guythetechie

Release version

APIOps Toolkit for Azure APIM v7.0.0-alpha.1.0.3

Describe the bug

The extractor writes the wrong loggerId for workspace-scoped diagnostics that reference workspace-scoped loggers. This causes the publisher to fail when publishing the diagnostic.

Expected behavior

The diagnosticInformation.json file should look like:

{
  "properties": {
    "loggerId": "/workspaces/[workspacename]/loggers/[name]"
  }
}

Actual behavior

The diagnosticInformation.json file looks like:

{
  "properties": {
    "loggerId": "/loggers/[name]"
  }
}

Reproduction Steps

  1. Add an application insights resource to the workspace (workspace -> Application insights).
  2. Create a diagnostic that references the application insights resource (workspace -> APIs -> All APIs -> Settings).
  3. Run the extractor. /artifacts/workspaces/workspaceName/diagnostics/diagnosticName/diagnosticInformation.json will have a service-level loggerId, not a workspace-level loggerId.
  4. Run the publisher. It will fail with:
Could not obtain mandatory reference to WorkspaceLoggerResource in property LoggerId of DTO workspaces/name/diagnostics/name. Expected '/loggers/name' to match the format '.../workspaces/workspaceName/loggers/{name}'.'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions