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

🚧 Initial attempt to support distributed traces for the cloud lifecycle #138

Draft
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

v1v
Copy link
Member

@v1v v1v commented Jun 24, 2021

🚧

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

What

Given the CloudProvisioningListener let's create specific transactions for the one-shot cloud provisioning.

This is just exploring whether it can provide enough context.

OTOH, it uses the same pattern that was done for the build transactions.

Details

UI

K8s workers

Expand to view

image

image

  • Trace attributes:

image

  • Span attributes

image

GCE workers

Expand to view

  • Trace attributes:

image

image

  • Span Attributes

image

  • Trace lifecycle

image

Follow ups

  • 2.135.1 seems to have some issues with the CloudProvisioning and the one-shot workers are non-gracefully closed. I tried with 2.189.1 and I was not able to see the issue. Can we bump the version? I'll probably do at least for this PR to be able to test the whole lifecycle otherwise it will be always reported as failure
  • Support AWS provisioner.

Tasks

  • Given the node can we know the build? If so, can we link both transactions the one for the build and the one for the cloud lifecycle?

Issues

##95

@v1v v1v changed the title Initial attempt to support distributed traces for the cloud lifecycle 🚧 Initial attempt to support distributed traces for the cloud lifecycle Jun 24, 2021
*/
@Extension(dynamicLoadable = YesNoMaybe.YES)
@Symbol("cloudSpanNamingStrategy")
public class CloudSpanNamingStrategy {
Copy link
Member Author

Choose a reason for hiding this comment

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

From:

image

To:

image

NodeProvisioner.PlannedNode plannedNode = plannedNodes.iterator().next();

String rootSpanName = this.cloudSpanNamingStrategy.getRootSpanName(plannedNode);
JenkinsOpenTelemetryPluginConfiguration.StepPlugin stepPlugin = JenkinsOpenTelemetryPluginConfiguration.get().findStepPluginOrDefault("cloud", cloud.getDescriptor());
Copy link
Member Author

Choose a reason for hiding this comment

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

image

pom.xml Outdated
@@ -19,7 +19,7 @@
<properties>
<revision>0.16</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.235.5</jenkins.version>
<jenkins.version>2.277.1</jenkins.version>
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying to workaround the issue in my local environment since I get some stacktrace errors:

WARNING hudson.slaves.NodeProvisioner#lambda: Unexpected exception encountered while provisioning agent

So maybe, my machine is too slow that somehow that particular issue happens....

Copy link
Member Author

Choose a reason for hiding this comment

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

image

v1v added 5 commits July 4, 2021 18:38
…oner#lambda: Unexpected exception encountered while provisioning agent'"

This reverts commit 091504e.
…oner#lambda: Unexpected exception encountered while provisioning agent'"

This reverts commit baa08c8.
…oner#lambda: Unexpected exception encountered while provisioning agent'"

This reverts commit df3556e.
@v1v v1v self-assigned this Jul 4, 2021
@v1v v1v added the enhancement New feature or request label Jul 4, 2021
v1v added 6 commits July 4, 2021 18:54
…r-cloud-provisioning

* upstream/master:
  Support span labels with the plugin details for the SimpleBuildStep implementations (jenkinsci#137)
Require upper bound dependencies error for commons-io:commons-io:2.6 paths to dependency are:
+-io.jenkins.plugins:opentelemetry:0.16-SNAPSHOT
  +-org.jenkins-ci.plugins:google-compute-engine:4.3.8
    +-commons-io:commons-io:2.6
…r-cloud-provisioning

* upstream/master:
  Explicitly specify the initial git branch name to "master" Because the default git branch name is more frequently set to "main" on development environments
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release opentelemetry-0.16
@v1v v1v force-pushed the feature/traces-for-cloud-provisioning branch from 5f2490a to 4f3e52b Compare July 12, 2021 13:31
public static final AttributeKey<String> CI_CLOUD_LABEL = AttributeKey.stringKey("ci.cloud.label");
public static final AttributeKey<String> CI_CLOUD_NAME = AttributeKey.stringKey("ci.cloud.name");
/**
* @see <a href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud.md">cloud semantic conventions</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to create a dedicated class to hold these cloud attributes like OTelCloudSemanticAttributes ? It was misleading for me to see these attributes on the JenkinsOtelSemanticAttributes. I was wondering if we missed the Otel Cloud attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants