Exemplo n.º 1
0
        public AppInsightElasticSearchSink(
            ITelemetryProcessor next,
            IConfiguration config,
            ILogger logger)
            : base(config, logger, nameof(AppInsightElasticSearchSink))
        {
            _next = next;

            // Reflection: Create Instance of ITransformOpenSchema
            var openSchemaConfig = new AssemblyInfoConfig();

            config.GetSection(ElasticSearchSinkConfig.TransformOutputSection).Bind(openSchemaConfig);
            var factoryType = Type.GetType(openSchemaConfig.ClassAssembly, throwOnError: true);

            _transformOpenSchema = Activator.CreateInstance(factoryType) as ITransformOutput;
        }
        public AppInsightBlobSink(
            ITelemetryProcessor next,
            IConfiguration config,
            IConfiguration schemaConfig,
            ILogger logger,
            IEnumerable <CloudBlobClient> blobClients,
            Func <CloudBlockBlob, Task> onBlobWrittenFunc,
            Func <string> containerNameFunc,
            string dataSource,
            string fileType)
            : base(config, logger, blobClients, onBlobWrittenFunc, containerNameFunc, dataSource, fileType)
        {
            _next = next;

            // Reflection: Create Instance of ITransformOpenSchema
            TransformConfig openSchemaConfig = new TransformConfig();

            schemaConfig.Bind(openSchemaConfig);
            var factoryType = Type.GetType(openSchemaConfig.TransformOutput.ClassAssembly, throwOnError: true);

            _transform  = Activator.CreateInstance(factoryType) as ITransformOutput;
            _dataSource = dataSource;
        }