Skip to content

Add IBM Instana Exporter #378

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

HeenaBansal20
Copy link
Contributor

This PR contributes IBM instana exporter which can be used to send the data to Instana agent.

@HeenaBansal20 HeenaBansal20 requested a review from a team as a code owner May 22, 2025 16:09
@HeenaBansal20 HeenaBansal20 marked this pull request as draft May 22, 2025 16:09
Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 49.42085% with 131 lines in your changes missing coverage. Please review.

Project coverage is 82.37%. Comparing base (e0c6ed6) to head (f2b6607).

Files with missing lines Patch % Lines
src/Exporter/Instana/src/InstanaTransport.php 0.00% 114 Missing ⚠️
src/Exporter/Instana/src/SpanExporterFactory.php 0.00% 11 Missing ⚠️
src/Exporter/Instana/src/SpanConverter.php 96.52% 4 Missing ⚠️
src/Exporter/Instana/src/SpanExporter.php 89.47% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #378      +/-   ##
============================================
- Coverage     83.42%   82.37%   -1.05%     
- Complexity     1949     2028      +79     
============================================
  Files           142      146       +4     
  Lines          8143     8402     +259     
============================================
+ Hits           6793     6921     +128     
- Misses         1350     1481     +131     
Flag Coverage Δ
Aws 92.59% <ø> (ø)
Context/Swoole 0.00% <ø> (ø)
Exporter/Instana 49.42% <49.42%> (?)
Instrumentation/AwsSdk 81.13% <ø> (ø)
Instrumentation/CakePHP 20.40% <ø> (ø)
Instrumentation/CodeIgniter 73.55% <ø> (ø)
Instrumentation/Curl 90.42% <ø> (ø)
Instrumentation/Doctrine 92.72% <ø> (ø)
Instrumentation/ExtAmqp 88.48% <ø> (ø)
Instrumentation/ExtRdKafka 86.11% <ø> (ø)
Instrumentation/Guzzle 75.58% <ø> (ø)
Instrumentation/HttpAsyncClient 78.04% <ø> (ø)
Instrumentation/IO 70.68% <ø> (ø)
Instrumentation/Laravel 69.68% <ø> (ø)
Instrumentation/MongoDB 74.28% <ø> (ø)
Instrumentation/MySqli 95.81% <ø> (ø)
Instrumentation/OpenAIPHP 87.21% <ø> (ø)
Instrumentation/PDO 94.21% <ø> (ø)
Instrumentation/Psr14 76.47% <ø> (ø)
Instrumentation/Psr15 89.15% <ø> (ø)
Instrumentation/Psr16 97.50% <ø> (ø)
Instrumentation/Psr18 77.46% <ø> (ø)
Instrumentation/Psr3 67.01% <ø> (ø)
Instrumentation/Psr6 97.61% <ø> (ø)
Instrumentation/ReactPHP 99.45% <ø> (ø)
Instrumentation/Slim 86.11% <ø> (ø)
Instrumentation/Symfony 84.74% <ø> (ø)
Instrumentation/Yii 77.50% <ø> (ø)
Logs/Monolog 100.00% <ø> (ø)
Propagation/Instana 98.11% <ø> (ø)
Propagation/ServerTiming 100.00% <ø> (ø)
Propagation/TraceResponse 100.00% <ø> (ø)
ResourceDetectors/Azure 91.66% <ø> (ø)
ResourceDetectors/Container 93.02% <ø> (ø)
ResourceDetectors/DigitalOcean 100.00% <ø> (ø)
Sampler/RuleBased 33.51% <ø> (ø)
Shims/OpenTracing 92.45% <ø> (ø)
Symfony 87.81% <ø> (ø)
Utils/Test 87.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Exporter/Instana/src/SpanExporter.php 89.47% <89.47%> (ø)
src/Exporter/Instana/src/SpanConverter.php 96.52% <96.52%> (ø)
src/Exporter/Instana/src/SpanExporterFactory.php 0.00% <0.00%> (ø)
src/Exporter/Instana/src/InstanaTransport.php 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0c6ed6...f2b6607. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

private ?string $agentUuid = null,
private ?string $agentPid = null
) {
$this->defaultServiceName = ResourceInfoFactory::defaultResource()->getAttributes()->get(ResourceAttributes::SERVICE_NAME);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It feels inefficient to do this, since it will re-evaluate all configured resource detectors. Have you found that it's possible for a span to not have this resource attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I found it mandatory because , if OTEL_SERVICE_NAME is not defined the resource for attribute SERVICE_NAME returns null and not default value of resource which is unknown_service:php
$span->getResource()->getAttributes()->get(ResourceAttributes::SERVICE_NAME)

Copy link
Collaborator

@brettmc brettmc left a comment

Choose a reason for hiding this comment

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

Can you please ensure license is appropriate per https://github.com/cncf/foundation/blob/main/charter.md#11-ip-policy and matches what other packages have?

@HeenaBansal20 HeenaBansal20 marked this pull request as ready for review May 23, 2025 06:35
{
for ($attempt = 0; $attempt < self::ATTEMPTS && !$this->performAnnounce(); $attempt++) {
self::logDebug('Discovery request failed, attempt ' . (string) $attempt);
sleep(5);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is blocking. Should it be configurable?

Copy link
Contributor Author

@HeenaBansal20 HeenaBansal20 May 27, 2025

Choose a reason for hiding this comment

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

You are right it should be configurable, I updated the default value as 1 and added it as parameter for transport object.
And improved the sleep distance between consecutive retries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed. Added no of attempts as configurable option for instanaTransport layer. default value is set to 1.

return true;
}

sleep(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

As above.

@HeenaBansal20
Copy link
Contributor Author

Can you please ensure license is appropriate per https://github.com/cncf/foundation/blob/main/charter.md#11-ip-policy and matches what other packages have?

@brettmc , We are good from polices perspective. We are having Apache2.0 License for this exporter.
Any other concerns you have w.r.t to above ?

@HeenaBansal20
Copy link
Contributor Author

@brettmc , @ChrisLightfootWild
just a gentle follow-up on this PR. We'd really appreciate a review when you have a moment, as we'd love to see this included soon if possible to keep up with product release dates. Let me know if anything needs to be updated or clarified. Thanks again for your time and all your work on the project!

@HeenaBansal20
Copy link
Contributor Author

@brettmc , @ChrisLightfootWild just a gentle follow-up on this PR. We'd really appreciate a review when you have a moment, as we'd love to see this included soon if possible to keep up with product release dates. Let me know if anything needs to be updated or clarified. Thanks again for your time and all your work on the project!

@ChrisLightfootWild , @brettmc ,
Another gentle followup on the this PR. I'd really appreciate your review on this.
Thank you.

@HeenaBansal20
Copy link
Contributor Author

@brettmc , @ChrisLightfootWild just a gentle follow-up on this PR. We'd really appreciate a review when you have a moment, as we'd love to see this included soon if possible to keep up with product release dates. Let me know if anything needs to be updated or clarified. Thanks again for your time and all your work on the project!

@ChrisLightfootWild , @brettmc , Another gentle followup on the this PR. I'd really appreciate your review on this. Thank you.

@bobstrecansky @Nevay , I am trying to reach @brettmc @ChrisLightfootWild since two weeks. I hope everything is good at their end. Do you think you guys can help me to move this PR forward and reviewing this PR in their absence.


## Issues

This repo is maintained by IBM Instana and is read-only. Issues should be reported as part of standard [Instana product support](https://www.ibm.com/support/pages/instana-support).
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this needs to change. It's not really read-only, this is the primary source of this exporter now, right?

Having contrib packages with an external responsibility hasn't really come up before (well, AWS, but we're not managing that well!), but maybe something like: This exporter is primarily maintained by contributors from IBM. Issues may be raised at <link> - I've added this to discuss at our next SIG meeting, as I think it's worth deciding on and documenting responsibilities and expectations for 3rd party products...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @brettmc for looking :-) ,
Yes I agree , this is not read-only now. I'll update the readme as suggested.

@HeenaBansal20
Copy link
Contributor Author

@brettmc , Did you get a chance to decide on how this PR should move on?

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

Successfully merging this pull request may close these issues.

3 participants