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

add target in case there is no host in target #2225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajaygupta2790
Copy link
Contributor

The current grpc instrumentation expects host value with a port that may not always be true. In our project, we usean internal host without a port value

target = kwargs.get("target") or args[0]
if ":" in target:
    host, port = target.split(":")
    try:
        port = int(port)
    except ValueError:
        port = None
else:
    host, port = None, None

This results in span showing None value and we cannot track the external host value. All grpc hosts are clubbed together under https://none/ value

The proposal is to keep the target value as is in case there is no ':' in the host and keep the port as None

@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Feb 28, 2025
@xrmx
Copy link
Member

xrmx commented Feb 28, 2025

Thanks, care to add a test too please?

@ajaygupta2790
Copy link
Contributor Author

test case file is missing for grpc, need some suggestions on where to start @xrmx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants