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

Cannot use CI Visibility with DogStatsD over Unix Domain Socket #283

Open
usmonster opened this issue Mar 28, 2022 · 4 comments
Open

Cannot use CI Visibility with DogStatsD over Unix Domain Socket #283

usmonster opened this issue Mar 28, 2022 · 4 comments
Labels
kind/feature-request Feature request related issue

Comments

@usmonster
Copy link

usmonster commented Mar 28, 2022

I'm using the Datadog plugin on Jenkins with the Datadog Agent and a Unix socket configuration.
This is working fine for metrics reporting, but not for CI Visibility/traces. Looking at Jenkins logs during a pipeline run, I see the plugin is trying to use HTTP instead of the configured DSD, and so it fails (screenshot further below).

I've tried looking at the plugin source code and found no clue, so I'm wondering if there's something I'm missing, but I suspect it's a bug, i.e. that the plugin was not designed with the unix socket configuration in mind (cf. #242). Thanks for any insights you might have!

To Reproduce
Steps to reproduce the behavior:

  1. Set up the plugin using a Unix Socket configuration
  2. Enable CI Visibility (you'll have to set a port to enable Traces collection.. I set 0), and save the configuration
  3. Create a Jenkins logger for Datadog-related classes (see screenshot below)
  4. Launch a Jenkins build and let it run to completion
  5. Check logs for the logger created in step 3
  6. See errors (e.g. "protocol = http host = null")

Expected behavior
The plugin should use the DSD configuration (not HTTP), traces should be sent without error, and Jenkins build data should show up in Datadog's Pipeline Visibility feature.

Screenshots

Here's how the plugin configuration looks in Jenkins:

image

(Note that I have to set 0 for the Traces Collection Port to enable CI Visibility; the "Test traces connection" button fails, but maybe this is expected behavior in this case? I can still save the configuration.)

Here is the Jenkins logger configuration:

image

Here are the logs that show the error:

image

Environment and Versions:

  • Datadog Plugin version 3.5.0
  • Jenkins version: 2.336
  • Jenkins chart version: 3.11.5

Additional context

Jenkins Logs

Here are the same logs as in the previous screenshot (included as text for searches):

Start DatadogBuildListener#onFinalized
Mar 23, 2022 3:38:10 PM FINE org.datadog.jenkins.plugins.datadog.DatadogUtilities
The list of Global Job Tags are: []
Mar 23, 2022 3:38:10 PM FINE org.datadog.jenkins.plugins.datadog.DatadogUtilities
Using unix hostname found via `/bin/hostname -f`. Hostname: jenkins-0.jenkins.ep.svc.cluster.local
Mar 23, 2022 3:38:10 PM FINE org.datadog.jenkins.plugins.datadog.clients.DatadogAgentClient
Finished build trace
Mar 23, 2022 3:38:10 PM FINE org.datadog.jenkins.plugins.datadog.listeners.DatadogBuildListener
End DatadogBuildListener#onFinalized
Mar 23, 2022 3:38:10 PM FINE org.datadog.jenkins.plugins.datadog.DatadogUtilities
Jenkins proxy configuration not found
Mar 23, 2022 3:38:10 PM FINE org.datadog.jenkins.plugins.datadog.DatadogUtilities
Using HttpURLConnection, without proxy
Mar 23, 2022 3:38:10 PM SEVERE org.datadog.jenkins.plugins.datadog.DatadogUtilities severe
protocol = http host = null
Mar 23, 2022 3:38:10 PM FINER org.datadog.jenkins.plugins.datadog.transport.LoggerHttpErrorHandler
protocol = http host = null: java.lang.IllegalArgumentException: protocol = http host = null
	at java.base/sun.net.spi.DefaultProxySelector.select(DefaultProxySelector.java:192)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1367)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1342)
	at org.datadog.jenkins.plugins.datadog.transport.HttpSender.blockingSend(HttpSender.java:77)
	at org.datadog.jenkins.plugins.datadog.transport.HttpSender.run(HttpSender.java:55)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Mar 23, 2022 3:38:10 PM SEVERE org.datadog.jenkins.plugins.datadog.DatadogUtilities severe
java.lang.IllegalArgumentException: protocol = http host = null
Mar 23, 2022 3:38:10 PM FINE org.datadog.jenkins.plugins.datadog.clients.DatadogAgentClient
Send pipeline traces.
Mar 23, 2022 3:38:10 PM FINER org.datadog.jenkins.plugins.datadog.transport.LoggerHttpErrorHandler
java.lang.IllegalArgumentException: protocol = http host = null: java.lang.RuntimeException: java.lang.IllegalArgumentException: protocol = http host = null
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1534)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3135)
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:536)
	at org.datadog.jenkins.plugins.datadog.transport.HttpSender.blockingSend(HttpSender.java:90)
	at org.datadog.jenkins.plugins.datadog.transport.HttpSender.run(HttpSender.java:55)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalArgumentException: protocol = http host = null
	at java.base/sun.net.spi.DefaultProxySelector.select(DefaultProxySelector.java:192)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
	... 7 more

@usmonster usmonster added the kind/bug Bug related issue label Mar 28, 2022
@drodriguezhdez
Copy link
Collaborator

drodriguezhdez commented Apr 6, 2022

Thanks @usmonster for reporting the issue. After investigating a bit, I can confirm that Unix Domain Sockets are not supported for sending CI Visibility traces. I updated our docs with this limitation and we will work on adding support for this in a near future.

@drodriguezhdez drodriguezhdez self-assigned this Apr 7, 2022
@drodriguezhdez drodriguezhdez added kind/feature-request Feature request related issue and removed kind/bug Bug related issue labels Apr 28, 2022
@github-actions
Copy link

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale Stale - Bot reminder label May 29, 2022
@usmonster
Copy link
Author

usmonster commented May 30, 2022

Hello! I can confirm that the issue is reproducible even after upgrading the plugin to the latest version 4.0.0. (Details remain the same.) Thanks!

@usmonster
Copy link
Author

Hello again! Can the stale label please be removed? Thanks!

@drodriguezhdez drodriguezhdez removed the stale Stale - Bot reminder label Jul 1, 2022
@drodriguezhdez drodriguezhdez removed their assignment Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request Feature request related issue
Projects
None yet
Development

No branches or pull requests

2 participants