Example #1
0
        public TelemetryEvents(
            FabricClient fabricClient,
            ServiceContext context,
            ITelemetryEventSource eventSource)
        {
            this.eventSource    = eventSource;
            this.serviceContext = context;
            var appInsightsTelemetryConf = TelemetryConfiguration.CreateDefault();

            appInsightsTelemetryConf.InstrumentationKey = TelemetryConstants.AppInsightsInstrumentationKey;
            appInsightsTelemetryConf.TelemetryChannel.EndpointAddress = TelemetryConstants.TelemetryEndpoint;
            this.telemetryClient = new TelemetryClient(appInsightsTelemetryConf);
            ClusterIdentificationUtility clusterIdentificationUtility = null;

            try
            {
                clusterIdentificationUtility = new ClusterIdentificationUtility(fabricClient);
                clusterIdentificationUtility.GetClusterIdAndType(
                    out this.clusterId,
                    out this.tenantId,
                    out this.clusterType);
            }
            finally
            {
                clusterIdentificationUtility?.Dispose();
            }
        }
Example #2
0
        public TelemetryEvents(FabricClient fabricClient, ITelemetryEventSource eventSource)
        {
            this.fabricClient = fabricClient;
            this.eventSource  = eventSource;
            var appInsightsTelemetryConf = TelemetryConfiguration.Active;

            // in the current version the instrumentation key is hard-coded
            // adding AIF- to instrumentation key, and changing the endpoint to send telemetry to Vortex instead of AI.
            appInsightsTelemetryConf.InstrumentationKey = (AppInsightsInstrumentationKey == TokenString) ? "" : AppInsightsInstrumentationKey;
            appInsightsTelemetryConf.TelemetryChannel.EndpointAddress = AppInsightsEndPointAddress;
            this.telemetryClient = new TelemetryClient(appInsightsTelemetryConf);
        }
        public TelemetryEvents(
            FabricClient fabricClient,
            ServiceContext context,
            ITelemetryEventSource eventSource,
            CancellationToken token)
        {
            this.eventSource    = eventSource;
            this.serviceContext = context;
            var appInsightsTelemetryConf = TelemetryConfiguration.CreateDefault();

            appInsightsTelemetryConf.InstrumentationKey = TelemetryConstants.AppInsightsInstrumentationKey;
            appInsightsTelemetryConf.TelemetryChannel.EndpointAddress = TelemetryConstants.TelemetryEndpoint;
            this.telemetryClient = new TelemetryClient(appInsightsTelemetryConf);

            var clusterInfoTuple = ClusterIdentificationUtility.TupleGetClusterIdAndTypeAsync(fabricClient, token).GetAwaiter().GetResult();

            this.clusterId   = clusterInfoTuple.Item1;
            this.tenantId    = clusterInfoTuple.Item2;
            this.clusterType = clusterInfoTuple.Item3;
        }