internal void IndexEvent(TelemetryEventBase plainEvent) { try { //Check if we can connect to the ElasticSearch Server if (_ElasticClient != null && !_ElasticClient.IndexAsync <BytesResponse>(_ElasticIndex, _ElasticType, PostData.Serializable(plainEvent)).Result.Success) { logger.Error("Server settings are not configured"); _ElasticClient = null; return; } } catch (Exception e) { logger.Fatal(e); } }
private AnalyticsWrapper() { try { _AppConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location); //Load custom app.config for this assembly _TypeCobolVersion = _AppConfig.AppSettings.Settings["TypeCobolVersion"].Value; //Init base event, contains version, generated session id, user id. _EventBase = new TelemetryEventBase() { SessionId = Guid.NewGuid().ToString(), UserId = Environment.UserName, TypeCobolVersion = _TypeCobolVersion }; } catch (Exception e) { logger.Fatal(e); } }
public TelemetryMetricsEvent(TelemetryEventBase baseEvent, EventType evenType, string metricname, double metricValue) : base(baseEvent.SessionId, baseEvent.UserId, baseEvent.TypeCobolVersion) { EventType = evenType; MetricName = metricname; MetricValue = metricValue; }
public TelemetryExceptionEvent(TelemetryEventBase baseEvent, Exception exception, string sourceCode) : base(baseEvent.SessionId, baseEvent.UserId, baseEvent.TypeCobolVersion) { Exception = exception; EventType = EventType.Exception; SourceCode = sourceCode; }
public TelemetryEvent(TelemetryEventBase baseEvent, EventType evenType, string content) : base(baseEvent.SessionId, baseEvent.UserId, baseEvent.TypeCobolVersion) { EventType = evenType; Content = content; }