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

Session creation fails #120

Open
securigy opened this issue Dec 25, 2021 · 8 comments
Open

Session creation fails #120

securigy opened this issue Dec 25, 2021 · 8 comments

Comments

@securigy
Copy link

I am using your example and am trying to run it.

  1. However the session creation returns false.
    So what do I do wrong?
  2. Another issue is that if the IP that I am using for session creation is incorrect (like inactive network adapter then the application hangs forever and I am not able to kill the process neither in Visual Studio (Debug->Stop) not in Task Manager, and in both cases getting "Access is denied" while I am logged in as admin and running the Visual Studio as admin...
    So how do I resolve at least Feature/safe state transitions #1? It is really critical...

` string endpointURL = "https://bf28096kgw.bf.dynatrace.com/mbeacon"; // the endpointURL can be found in the Dynatrace UI ?? What UI? Where?
string applicationID = "D2CB8ED1-D63C-4198-B12B-85EFAD1481DB"; // the application id can be found in the Dynatrace UI
long deviceID = 42L; // an ID that uniquely identifies the device

        var openKit = new DynatraceOpenKitBuilder(endpointURL, applicationID, deviceID)
            .WithApplicationVersion("1.0")
            .WithOperatingSystem(Environment.OSVersion.VersionString)
            .Build();

        // we wait for OpenKit to be initialized
        // if you skip the line, OpenKit will be initialized asynchronously

        // create a new session
        var ipAddress = GetIpAddress();
        var session = openKit.CreateSession(ipAddress);

        int timeoutInMilliseconds = 30 * 1000;
       // the returned 'success' is false
        bool success = openKit.WaitForInitCompletion(timeoutInMilliseconds);`
@TheHighriser
Copy link
Contributor

Hi,

So you said in the example "the endpointURL can be found in the Dynatrace UI ?? What UI? Where?" - So do you actually have access to a Dynatrace Server? Within the web UI of the server you can create an custom application, which provides you a wizard that is containing all this kind of information.

So did you use this data? Because if not this would explain the session creation returning false.

@stefaneberl
Copy link
Contributor

Hi,

ad issue 1: Please be aware that not the session creation returns false, but rather your wait call to wait for OpenKit to be initialized. This is a typical indicator that either your endpoint URL or your application ID is invalid. If those values are correct, then there might be an issue reaching the endpoint URL.
The values can be found in the application's settings UI, to be exact in the instrumentation wizard.

ad issue 2: Unfortunately I do not see how you determine your IP, so I cannot give you any advice. However, there is an overloaded parameterless CreateSession method, where the IP is determined "automatically" on the receiving end. See also https://github.com/Dynatrace/openkit-dotnet/blob/main/src/Dynatrace.OpenKit/API/IOpenKit.cs#L86

Another hint, please do not specify a hardcoded deviceID, as this value should be unique per device/installation, depending on your use case.

Best regards
Stefan

@securigy
Copy link
Author

securigy commented Jan 10, 2022 via email

@stefaneberl
Copy link
Contributor

Happy to hear you found the cause of your problem.

I've created a test application and specified a non-existing application id, to block the WaitForInitCompletion call. I'm able to stop debugging in Visual Studio (2019) while waiting for the call and I'm also able to kill the process in Task Manager. So I would assume it's not our code that is causing your stop/kill issue.

@securigy
Copy link
Author

securigy commented Jan 11, 2022 via email

@stefaneberl
Copy link
Contributor

I'm awfully sorry, but I will not install Norton 360 on my machine, for several reasons.
If Norton 360 is interfering with Visual Studio and/or Task Manager, I recommend contacting the Norton Support (https://support.norton.com/sp/en/us/home/current/contact).

@securigy
Copy link
Author

securigy commented Jan 12, 2022 via email

@stefaneberl
Copy link
Contributor

Hi @securigy,

sorry if my comment sounded offensive to you. That was not my intention.
I appreciate your findings and that you're sharing them with us. We'll keep them in mind, for future troubleshooting.

Best regards
Stefan

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

No branches or pull requests

3 participants