Exemple #1
0
        public async Task traceTagsRWTest()
        {
            Sdk <object> sdk = GetSdk();

            // Add a tag to a trace
            string traceId            = config.TRACE_ID;
            Guid   uuid               = System.Guid.NewGuid();
            string randomUUIDString   = uuid.ToString();
            AddTagsToTraceInput input = new AddTagsToTraceInput(traceId, new string[] { randomUUIDString, "tag1", "tag2" });

            TraceState <Object, Object> state = await sdk.AddTagsToTraceAsync <Object>(input);

            Assert.Equal(traceId, state.TraceId);

            // search the trace by tags
            List <String> tags = new List <string>();

            tags.Add(randomUUIDString);
            SearchTracesFilter           f   = new SearchTracesFilter(tags);
            TracesState <Object, Object> res = await sdk.SearchTracesAsync <Object>(f, new PaginationInfo());

            Assert.Equal(1, res.TotalCount);
            Assert.Equal(traceId, res.Traces[0].TraceId);
        }