private static int Main(string[] args)
        {
            if (!Environment.Is64BitOperatingSystem | Environment.OSVersion.Platform != PlatformID.Win32NT)
            {
                Console.WriteLine("only supported on win32 x64");
            }

            // default constructor
            Collector collector = new Collector(args, true);

            // use config to modify / validate config
            // config.Validate();
            ConfigurationOptions config = collector.Instance.Config;

            // collect data
            int retval = collector.Collect();

            // mitigation for dtr files not being csv compliant causing kusto ingest to fail
            if (collector.Instance.Kusto.IngestFileObjectsFailed.Count() > 0 &&
                config.IsKustoConfigured() &&
                config.KustoUseBlobAsSource == true &&
                config.FileType == DataFile.FileTypesEnum.trace)
            {
                KustoConnection kusto = collector.Instance.Kusto;
                Log.Warning("failed ingests due to csv compliance. restarting.");

                // change config to download files to parse and fix csv fields
                config.KustoUseBlobAsSource = false;
                config.KustoRecreateTable   = false;
                retval = collector.Collect(kusto.IngestFileObjectsFailed.Select(x => x.FileUri).ToList());
            }

            return(retval);
        }
Esempio n. 2
0
        private bool InitializeKusto()
        {
            if (Config.IsKustoConfigured() | Config.IsKustoPurgeRequested())
            {
                Kusto = new KustoConnection();
                return(Kusto.Connect());
            }

            return(true);
        }