just installed loki locally on my windows computer(same as grafana runs on), and i cannot "save and test".

Still have the same problem.
Error messages when trying to “save & test” loki as a datasource:

If i go to http://localhost:3100/, i get “404 page not found”, which means that the loki server is running.

When i try to press “save & test”, i get the following log entries:
Grafana logs:

logger=context traceID=00000000000000000000000000000000 userId=1 orgId=1 uname=admin t=2022-12-07T15:30:46.2934775+01:00 level=error msg="Failed to call resource" error="Get \"http://localhost:3100/loki/api/v1/labels?start=1670422816283000000&end=1670423416283000000\": net/http: request canceled (Client.Timeout exceeded while awaiting headers)" traceID=00000000000000000000000000000000
logger=context traceID=00000000000000000000000000000000 userId=1 orgId=1 uname=admin t=2022-12-07T15:30:46.296726+01:00 level=error msg="Request Completed" method=GET path=/api/datasources/9/resources/labels status=500 remote_addr=127.0.0.1 time_ms=30012 duration=30.0127575s size=83 referer=http://grafana.staged-by-discourse.com/datasources/edit/YJF87QK4k traceID=00000000000000000000000000000000

Loki logs:

ts=2022-12-07T14:55:00.0223554Z caller=spanlogger.go:80 user=fake method=query.Label level=info org_id=fake latency=fast query_type=labels length=10m0s duration=566.4µs status=200 label= throughput=0B total_bytes=0B total_entries=2
level=warn ts=2022-12-07T14:55:05.7937448Z caller=pool.go:184 msg="removing frontend failing healthcheck" addr=172.29.176.1:9096 reason="rpc error: code = DeadlineExceeded desc = context deadline exceeded"
level=error ts=2022-12-07T14:55:05.7937448Z caller=scheduler_processor.go:182 org_id=fake msg="error notifying frontend about finished query" err="rpc error: code = Canceled desc = grpc: the client connection is closing" frontend=172.29.176.1:9096
level=error ts=2022-12-07T14:55:30.0319769Z caller=retry.go:73 org_id=fake msg="error processing request" try=0 err="context canceled"
level=error ts=2022-12-07T14:55:30.0319769Z caller=stats.go:57 component=frontend msg="failed to record query metrics" err="expected one of the *LokiRequest, *LokiInstantRequest, *LokiSeriesRequest, *LokiLabelNamesRequest, got "

My conclusion so far: Grafana and loki is running. Grafana can connect to loki.